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]>
This commit is contained in:
committed by
techknowlogick
parent
019f8a6446
commit
acf6b121c9
@@ -116,7 +116,7 @@ func dataSourceGiteaRepoRead(d *schema.ResourceData, meta interface{}) error {
|
||||
}
|
||||
username := strings.ToLower(usernameData.(string))
|
||||
|
||||
nameData, nameOk := d.GetOk("username")
|
||||
nameData, nameOk := d.GetOk("name")
|
||||
if !nameOk {
|
||||
return fmt.Errorf("name of repo must be passed")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user