Lerentis / terraform-provider-gitea

Terraform Provider for your Gitea Instance
https://registry.terraform.io/providers/Lerentis/gitea/latest
MIT License
22 stars 11 forks source link

"gitea_org" not working #33

Closed scream314 closed 1 year ago

scream314 commented 1 year ago

Describe the bug

Creating an org is successful. Running apply again still shows the org to be created (but obviously fails as it does exist, Error: 422 Unprocessable Entity: {"message":"user already exists [name: foobar]","url":"http://1.2.3.4:5678/api/swagger"}). I tried to import an existing org to a Terraform resource, but it fails with Error: Cannot import non-existent remote object. Sounds similar to https://github.com/Lerentis/terraform-provider-gitea/issues/1 and https://gitea.com/gitea/terraform-provider-gitea/issues/7, but without the panic.

To Reproduce

Try to create or import an org.

Expected behavior

Expected to find the newly created org and be able to import existing orgs.

Log Output If applicable, add logs to help explain your problem.

Additional Data Important for reproducability.

$ terraform -v
Terraform v1.3.9
on darwin_amd64
+ provider registry.terraform.io/lerentis/gitea v0.12.3

used through

$ terragrunt -v
terragrunt version v0.44.5
scream314 commented 1 year ago

Sorry, downgraded the provider to 0.12.0, which gave a better error message when importing: Error: 403 Forbidden. After that I tried to authenticate with username and password, and everything is working fine (apparently my token does not have the necessary permissions).

Scopes:

    repo
    admin:org
    user
    delete_repo
    admin:application