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

Delete machine pool user data files that did not get deleted yet by the lifecycle policy #593

Merged
merged 4 commits into from
Jun 20, 2024

Conversation

AndiDog
Copy link

@AndiDog AndiDog commented Jun 6, 2024

Towards giantswarm/roadmap#3442, fix for #592

Comment on lines +124 to +127
// Stop on last page of results
if len(out.Contents) == 0 {
break
}
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to avoid using the built-in paginator? https://aws.github.io/aws-sdk-go-v2/docs/making-requests/#using-paginators

@@ -97,6 +97,47 @@ func (s *Service) DeleteBucket() error {

log.Info("Deleting S3 Bucket")

// Delete machine pool user data files that did not get deleted
// yet by the lifecycle policy
for {
Copy link
Member

Choose a reason for hiding this comment

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

The machinepool feature is a feature that needs to be enabled using feature flags. We should probably check the feature flag before executing this logic.

@fiunchinho
Copy link
Member

I tested it, and it works like a charm. I'm going to go ahead and merge it, and talk to Andreas when he's back about the comments I wrote in the PR, just in case there is room for improvement, that we can do later on.

@fiunchinho fiunchinho merged commit 97afcee into release-2.3 Jun 20, 2024
3 of 5 checks passed
fiunchinho pushed a commit that referenced this pull request Jul 1, 2024
…he lifecycle policy (#593)

* Delete machine pool user data files that did not get deleted yet by the lifecycle policy

* Use paging for S3 results

* Log S3 list operation

* Handle NotFound
This was referenced Jul 1, 2024
fiunchinho added a commit that referenced this pull request Jul 4, 2024
* Add Giant Swarm fork modifications

* Push to Azure registry

* aws-cni-deleted-helm-managed-resources

* import-order

* Filter CNI subnets when creating EKS NodeGroup

* add godoc

* 🐛 Create a `aws.Config` with region to be able to work different AWS partition (like gov cloud or china AWS partition) (#588)

* create-aws-client-with-region

* 🐛 Add ID to secondary subnets (#589)

* give name to secondary subnets

* make linter happy

* Add non root volumes to AWSMachineTemplate

* Support adding custom secondary VPC CIDR blocks in `AWSCluster` (backport) (#590)

* S3 user data support for `AWSMachinePool` (#592)

* Delete machine pool user data files that did not get deleted yet by the lifecycle policy (#593)

* Delete machine pool user data files that did not get deleted yet by the lifecycle policy

* Use paging for S3 results

* Log S3 list operation

* Handle NotFound

* Remove duplicated argument

* Add `make test` to Circle CI build, S3 test fixes (#596)

* Cancel instance refresh on any relevant change to ASG instead of blocking until previous one is finished (which may have led to failing nodes due to outdated join token) (#598)

* Use feature gate for S3 storage (#599)

* Fixes after cherry-pick our customizations

---------

Co-authored-by: Andreas Sommer <andreas@giantswarm.io>
Co-authored-by: calvix <vaclav@giantswarm.io>
Co-authored-by: Mario Nitchev <marionitchev@gmail.com>
Co-authored-by: calvix <rozsypalek.vaclav@gmail.com>
fiunchinho pushed a commit that referenced this pull request Aug 21, 2024
…he lifecycle policy (#593)

* Delete machine pool user data files that did not get deleted yet by the lifecycle policy

* Use paging for S3 results

* Log S3 list operation

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

Successfully merging this pull request may close these issues.

2 participants