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

✨ s3: allow best effort delete for objects #4904

Merged
merged 3 commits into from
Apr 24, 2024

Conversation

r4f4
Copy link
Contributor

@r4f4 r4f4 commented Apr 3, 2024

What type of PR is this?
/kind feature

What this PR does / why we need it:
This change introduces a new config option for S3Bucket to allow best effort delete for S3 objects. This is useful to not fail cluster installs when the user has policies in place that prevent object deletion.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #4903

Special notes for your reviewer:

Checklist:

  • squashed commits
  • includes documentation
  • includes emojis
  • adds unit tests
  • adds or updates e2e tests

Release note:

Add a new field to S3Bucket, BestEffortDeleteObjects, to allow ignoring AccessDenied errors when deleting S3 objects.

This change introduces a new config option for `S3Bucket` to allow best
effort delete for S3 objects. This is useful to not fail cluster
installs when the user has policies in place that prevent object
deletion.
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority labels Apr 3, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @r4f4. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 3, 2024
@r4f4
Copy link
Contributor Author

r4f4 commented Apr 3, 2024

/retitle ✨ s3: allow best effort delete for objects

@k8s-ci-robot
Copy link
Contributor

@r4f4: Re-titling can only be requested by trusted users, like repository collaborators.

In response to this:

/retitle ✨ s3: allow best effort delete for objects

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@r4f4 r4f4 changed the title s3: allow best effort delete for objects ✨ s3: allow best effort delete for objects Apr 3, 2024
@r4f4
Copy link
Contributor Author

r4f4 commented Apr 3, 2024

CC @patrickdillon @mtulio

@Ankitasw Ankitasw added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 5, 2024
@r4f4
Copy link
Contributor Author

r4f4 commented Apr 5, 2024

/hold
Until I squash the commits.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 5, 2024
r4f4 added 2 commits April 8, 2024 16:37
If `S3Bucket.BestEffortDeleteObjects` is present and true,
`AccessDenied` errors will be ignored when deleting S3 objects. This is
useful when a user installs a clusters in an account with policies in
place to prevent object deletion, e.g:
```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Deny object deletions",
            "Effect": "Deny",
            "Principal": "*",
            "Action": "s3:DeleteObject",
            "Resource": "arn:aws:s3:::<bucketname>/*"
        }
    ]
}
```
Such errors should not prevent a successful install.
@r4f4
Copy link
Contributor Author

r4f4 commented Apr 8, 2024

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 8, 2024
@r4f4
Copy link
Contributor Author

r4f4 commented Apr 16, 2024

@Ankitasw I've addressed your feedback points. Can you take another look?

@r4f4
Copy link
Contributor Author

r4f4 commented Apr 22, 2024

@richardcase any comments on this?

@richardcase
Copy link
Member

/test ?

@k8s-ci-robot
Copy link
Contributor

@richardcase: The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-aws-build
  • /test pull-cluster-api-provider-aws-build-docker
  • /test pull-cluster-api-provider-aws-test
  • /test pull-cluster-api-provider-aws-verify

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-aws-apidiff-main
  • /test pull-cluster-api-provider-aws-e2e
  • /test pull-cluster-api-provider-aws-e2e-blocking
  • /test pull-cluster-api-provider-aws-e2e-clusterclass
  • /test pull-cluster-api-provider-aws-e2e-conformance
  • /test pull-cluster-api-provider-aws-e2e-conformance-with-ci-artifacts
  • /test pull-cluster-api-provider-aws-e2e-eks
  • /test pull-cluster-api-provider-aws-e2e-eks-gc
  • /test pull-cluster-api-provider-aws-e2e-eks-testing

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-aws-apidiff-main
  • pull-cluster-api-provider-aws-build
  • pull-cluster-api-provider-aws-build-docker
  • pull-cluster-api-provider-aws-test
  • pull-cluster-api-provider-aws-verify

In response to this:

/test ?

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@richardcase
Copy link
Member

/test pull-cluster-api-provider-aws-e2e
/test pull-cluster-api-provider-aws-e2e-eks

@richardcase
Copy link
Member

From my side this looks good

/approve

Until the e2e pass:

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 23, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: richardcase

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 23, 2024
@damdo
Copy link
Member

damdo commented Apr 23, 2024

/test pull-cluster-api-provider-aws-e2e

Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 23, 2024
@nrb nrb added this to the v2.5.0 milestone Apr 23, 2024
@damdo
Copy link
Member

damdo commented Apr 23, 2024

/test pull-cluster-api-provider-aws-e2e

2 similar comments
@damdo
Copy link
Member

damdo commented Apr 23, 2024

/test pull-cluster-api-provider-aws-e2e

@damdo
Copy link
Member

damdo commented Apr 24, 2024

/test pull-cluster-api-provider-aws-e2e

@r4f4
Copy link
Contributor Author

r4f4 commented Apr 24, 2024

@richardcase I think we're ready to remove the hold.

@damdo
Copy link
Member

damdo commented Apr 24, 2024

Considering the comment from @richardcase
#4904 (comment)

Given E2Es are green let's unhold this
/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 24, 2024
@k8s-ci-robot k8s-ci-robot merged commit 63c6635 into kubernetes-sigs:main Apr 24, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

s3: allow best effort delete for objects
6 participants