terraform-provider-minio
terraform-provider-minio copied to clipboard
Add resource_minio_s3_object 'source' support
Add resource_minio_s3_object 'source' support for PutObject
Only 'content' and 'content_base64' have been implemented sofar, this PR adds 'source' support for resource_minio_s3_object, derived from https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/s3/bucket_object.go#L388-L405
Reference
- Resolves: #552
Closing issues
- Closes: #552
Sorry for the delay in looking at this! It would be great to add some test cases here for CI if you have a chance
@pjsier Is there some sort of 'best practice' for testing opening/reading files in Go? I've only dabbled a bit in the language so far and I don't know much about writing unit tests in it.
@fhemberger I'm not sure on overall best practices, but I think we could leverage a similar pattern to the AWS provider adding a method to create tempfiles that can then be used later in the test
https://github.com/hashicorp/terraform-provider-aws/blob/43bd19db00807459b8c5ae3b4faaa91a183d3a7f/internal/service/s3/object_test.go#L702-L734
@pjsier I'm still having trouble setting up the unit tests, however, I'd really appreciate it if the fix could land anyways, as:
- The
sourceattribute is currently documented to be available, yet it's not implemented at all - There hasn't been a single unit test for
minio_s3_objectso far to build on. - The code is taken directly from Hashicorp's own official AWS provider.
So even without test cases, that's already an improvement over the current state.
/ping @pjsier @felladrin
Thanks @fhemberger! It's being released on v2.1.0.
@felladrin Thank you!