-
Notifications
You must be signed in to change notification settings - Fork 93
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
improvement(kms): cleanup AWS KMS aliases only if there are no VMs #8030
Conversation
Attempt to cleanup AWS KMS alias when DB nodes are still kept:
Deletion of the alias after a separate deletion of DB nodes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor is breaking the unittests
0b83b35
to
d5aa178
Compare
It will allow to be more flexible in importing other common utils to avoid circular imports.
Make the AWS KMS alias cleanup logic check VMs presence and skip deletion if some VMs have been found tagged with the same test-id. It will allow to make kept DB clusters be workable during it's lifetime.
Before this change we were deleting AWS kMS alias of a test run even if DB cluster was set to be kept ('keep' tag).
d5aa178
to
e2818b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
return self.cleaner.gcloud.run(f"container clusters delete {self.name} --zone {self.zone} --quiet") | ||
|
||
|
||
class GkeCleaner(GcloudContainerMixin): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this was only moved here, but I'll leave comment for the future: Api of this class is very misleading and complicated.
GkeCleaner
that doesn't have 'cleaning' methods - mostly listing resources (and e.g. list_gke_clusters
returns list of GkeClusterForCleaner
- so again mislead as it does not return gke cluster itself).
When introducing classes with simple goals like cleaning, let's make sure names, methods are consistent with this goal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but it is out of scope for this PR.
This PR is about fixing AWS KMS alias cleanups and dependency change with this moving of existing functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Testing
PR pre-checks (self review)
backport
labelsReminders
sdcm/sct_config.py
)unit-test/
folder)