Skip to content

Commit acf6b12

Browse files
petar.nikolovskitechknowlogick
authored andcommitted
Fetch correct value for name variable in gitea_repo data source (#9)
Hi all, I've noticed that data source for `gitea_repo` is not working. Instead of trying to fetch data from `/api/v1/repos/<username>/<name>` it sends a reques as `/api/v1/repos/<username>/<username>`. I've updated the code to fix this. Signed-off-by: petar.nikolovski <[email protected]> Reviewed-on: https://gitea.com/gitea/terraform-provider-gitea/pulls/9 Reviewed-by: techknowlogick <[email protected]> Co-authored-by: petar.nikolovski <[email protected]> Co-committed-by: petar.nikolovski <[email protected]>
1 parent 019f8a6 commit acf6b12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gitea/data_source_gitea_repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func dataSourceGiteaRepoRead(d *schema.ResourceData, meta interface{}) error {
116116
}
117117
username := strings.ToLower(usernameData.(string))
118118

119-
nameData, nameOk := d.GetOk("username")
119+
nameData, nameOk := d.GetOk("name")
120120
if !nameOk {
121121
return fmt.Errorf("name of repo must be passed")
122122
}

0 commit comments

Comments
 (0)