Skip to content
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

fix(s3): dont set ExpiredObjectDeleteMarker in lifecycle policy if da… #2116

Merged

Conversation

kkendzia
Copy link

@kkendzia kkendzia commented Nov 4, 2024

This PR solved the issue with a parameter collision in S3 Bucket Lifecycle Configurations.

According to https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html#lifecycle-config-conceptual-ex7 you cannot specify both Days / Date and ExpiredObjectDeleteMarker, resulting in a MalformedXML Error otherwise.

Description of your changes

This change is adapted to the behaviour of terraform provider aws: https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/s3/bucket_lifecycle_configuration.go#L664

When Date or Days is set, don't set ExpiredObjectDeleteMarker at all.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

tested by @simwak

  • Built
  • Tested with example MRs

@kkendzia kkendzia force-pushed the fix/s3_lifecycle_marker branch from f1a9b64 to 1bf5a43 Compare November 4, 2024 11:32
@kkendzia kkendzia marked this pull request as ready for review November 4, 2024 11:33
Copy link
Collaborator

@MisterMX MisterMX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you very much @kkendzia!

@MisterMX MisterMX merged commit 963a9dc into crossplane-contrib:master Nov 4, 2024
8 of 9 checks passed
Copy link

github-actions bot commented Nov 4, 2024

Successfully created backport PR #2118 for release-0.50.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants