-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Symmetric normalization for S3 Bucket Lifecycle Configuration #44539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jbonzo
wants to merge
5
commits into
hashicorp:main
Choose a base branch
from
jbonzo:b-s3-lifecycle-normalize-prefix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+14
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
b3b4389
to
d7d292e
Compare
d7d292e
to
ace96e1
Compare
66d2eac
to
6e72c13
Compare
6e72c13
to
f7841c8
Compare
Adding |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
aws-compatible-service
Issues related to compatibility with AWS-compatible services.
bug
Addresses a defect in current functionality.
service/s3
Issues and PRs that pertain to the s3 service.
size/M
Managed by automation to categorize the size of a PR.
size/XS
Managed by automation to categorize the size of a PR.
tests
PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
None
Description
This PR addresses a compatibility issue with Ceph RGW S3 lifecycle configurations where some Ceph RGW versions (confirmed in v19.2.3 Squid) add a deprecated
<Prefix>
element to lifecycle configuration responses as it's representation of having no prefix.When Ceph RGW returns
<Prefix></Prefix>
in API responses, the Terraform provider's wait loop usesreflect.DeepEqual
to compare configurations, which fails when comparingPrefix: nil
(what Terraform sent) withPrefix: ""
(what Ceph returns), causing timeouts during apply operations.This fix normalizes empty prefix strings to
nil
after reading lifecycle configurations from S3-compatible APIs, creating symmetry with the existing expand logic that converts empty strings tonil
before sending requests. This maintains compatibility with AWS S3 while restoring compatibility with Ceph RGW instances that exhibit this behavior.Observed Behavior
Terraform sends (PUT request):
Ceph RGW v19.2.3 returns (GET response):
AWS S3 returns (GET response):
The Difference: Ceph RGW adds
<Prefix></Prefix>
(empty string) when none was sent, while AWS S3 omits the deprecated Prefix element entirely.Relations
I think this issue Relates #43333 , but the logging provided in that issue isn't sufficient to prove itl
References
Here is the spot that normalizes the empty Prefix when expanding the resource.
terraform-provider-aws/internal/service/s3/bucket_lifecycle_configuration.go
Line 752 in 1c8a2d5
Output from Acceptance Testing