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

Pagination & Launch config deletion #115

Merged

Conversation

eytan-avisror
Copy link
Collaborator

@eytan-avisror eytan-avisror commented May 19, 2020

Fixes #114

This adds pagination for DescribeLaunchConfigurations and refactors create/update/delete to properly handle launch configuration deletion.

New logic will be called on CloudDiscovery instead of during update, and will delete the oldest launch configurations per instance group outside of the newest ones according to number of default retention (default 2) - we can make this configurable in the future.
IG Deletion now simply deletes all launch configs with the resource prefix.

  • BDD

@eytan-avisror eytan-avisror requested a review from a team as a code owner May 19, 2020 06:01
@codecov
Copy link

codecov bot commented May 19, 2020

Codecov Report

Merging #115 into master will decrease coverage by 0.36%.
The diff coverage is 82.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #115      +/-   ##
==========================================
- Coverage   86.93%   86.56%   -0.37%     
==========================================
  Files          10       10              
  Lines         995     1020      +25     
==========================================
+ Hits          865      883      +18     
- Misses         94       98       +4     
- Partials       36       39       +3     
Impacted Files Coverage Δ
controllers/provisioners/eks/cloud.go 90.62% <76.92%> (-0.53%) ⬇️
controllers/provisioners/eks/helpers.go 79.03% <77.77%> (-0.10%) ⬇️
controllers/provisioners/eks/delete.go 95.38% <85.71%> (-1.54%) ⬇️
controllers/provisioners/eks/create.go 100.00% <100.00%> (ø)
controllers/provisioners/eks/eks.go 65.78% <100.00%> (+0.92%) ⬆️
controllers/provisioners/eks/update.go 93.71% <100.00%> (-0.16%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90a8845...c12d8eb. Read the comment docs.

@@ -26,7 +27,8 @@ import (
)

const (
ProvisionerName = "eks"
ProvisionerName = "eks"
defaultLaunchConfigurationRetention = 2
Copy link
Collaborator

Choose a reason for hiding this comment

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

In a separate PR, we might want to make it configurable (or at least have some annotation that can override this).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I was trying to come up with a way to not add this to the CR, but using a controller flag also doesnt make much sense, because not all provisioners care about launch configurations (e.g. eks-managed).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Annotation is a good idea!

@eytan-avisror eytan-avisror merged commit 42e8e87 into keikoproj:master May 19, 2020
eytan-avisror added a commit that referenced this pull request May 19, 2020
* fix deletions & add pagination

* Update cloud.go

* Update delete.go

* fix test

* tidy

* Update update.go

* Update update.go

* get input inside create launch config
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.

LaunchConfiguration pagination and retention
2 participants