-
-
Notifications
You must be signed in to change notification settings - Fork 15
Fixes accidentally deleted serviceaccount and rolebinding objects #909
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nightkr
reviewed
Nov 21, 2024
…nymore. Operators should not call these with potentially wrong parameters, but instead use `build_rbac_resources` to retrieve the objects and read the name from there.
Once ready, please add a comment with a one-liner that can be copied into the release notes (if applicable, otherwise drop the release-note label). |
…ransition period.
nightkr
reviewed
Nov 22, 2024
Co-authored-by: Natalie Klestrup Röijezon <nat.roijezon@stackable.tech>
nightkr
previously approved these changes
Nov 22, 2024
siegfriedweber
approved these changes
Nov 23, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently it is possible that
servieAccount
androleBinding
objects accidentally get deleted if multiple clusters of the same type (airflow, zookeeper, ...) get deployed to the same namespace and one of them gets deleted.The issue is, that we don't name the serviceaccount and rolebinding objects after the clustername, but they are named the same for all cluster, so bacially just "airflow-rolebinding" and "airflow-serviceaccount" across the board.
When you new deploy two airflows into the same namespace and delete the wrong one of them again (the wrong one being the last that was deployed) then the rolebinding and serviceaccount are gone as well and the other cluster stops working as well.
Reason for "the last one" being the one that kills it is, because the ownerreferences of the rolebinding and serviceaccount point at this and the delete gets propagated to these two objects that are still needed by the other clusters.
This PR fixes how the names are built for the serviceAccount and roleBinding objects are created so that they are unique for each cluster.
fixes stackabletech/issues#675
Definition of Done Checklist