aminueza / terraform-provider-minio

Terraform provider for managing MinIO S3 buckets and IAM Users.
https://registry.terraform.io/providers/aminueza/minio
GNU Affero General Public License v3.0
233 stars 69 forks source link

feat: recreate user if not found anymore #534

Closed tobikris closed 10 months ago

tobikris commented 10 months ago

Recreate users if they cannot be found in reality anymore

This PR implements the following changes:

Reference

Closing issues

tobikris commented 10 months ago

@deefdragon Does this solve your issue? @felladrin PTAL

pjsier commented 10 months ago

Thanks for this PR! It looks good, but if you could add a test that would help with review. Not sure the best way of approaching that here, so feel free to update if you run into issues. Even a minimal example to reproduce would be helpful

tobikris commented 10 months ago

I tried to run the existing tests, but was not successful with Podman on MacOS. Do you have any hint for me to try again?

pjsier commented 10 months ago

Do you have any specific error messages? Worst case scenario, I think it's fine to use CI to validate any tests you can't get running locally

tobikris commented 10 months ago

The problem starts with the config already - on my machine the IP addresses of the containers are not the ones that are expected by the tests and scripts. Changing the IP addresses does not solve the issue either as the basic assumption of the tests/scripts (all containers can be reached by the other containers and the host on the same address) is not applicable on my machine. Even running the tests in another container on the bridge is not working as the test tries to access localhost:9001 (for the admin API probably).

I will try it using the CI for now.

deefdragon commented 10 months ago

it looks to address the issue in the users side, tho I don't remember if I also encountered this on other resources (buckets etc.).

mind, I've not tested it directly as the setup required to do so is a bit involved.

tobikris commented 10 months ago

I have added a test case that should test this recreation of a user.

felladrin commented 10 months ago

Thank you all! Tonight I'll merge and release it as v1.20.0.

felladrin commented 10 months ago

Folks, we'll merge it, but, unfortunately, we won't be able to release a new version until https://github.com/terraform-provider-minio/terraform-provider-minio/issues/531 is resolved.