Skip to content

Fix cleanup replicasets to only look at those in this ns#41

Merged
jackkleeman merged 1 commit into
mainfrom
fix-rs-ownership
Aug 27, 2025
Merged

Fix cleanup replicasets to only look at those in this ns#41
jackkleeman merged 1 commit into
mainfrom
fix-rs-ownership

Conversation

@jackkleeman

Copy link
Copy Markdown
Contributor

We have a bug where its possible for the cleanup logic to operate on replicasets in other namespaces, if there is a restatedeployment with the same name elsewhere, as we only checked the owned-by label which is just the name.

The owned-by label isn't really necessary, and was a hangover from when I thought we might want to do a label selector list. As the kube-rs caching mechanisms force us to range over all replicasets in all namespaces, a label approach doesn't make things any faster. So instead, we will check the namespace as a sense check, and then if that passes, check the uid and kind. Technically just a uid check would be sufficient, but no harm in some extra defense.

@jackkleeman
jackkleeman merged commit 5927121 into main Aug 27, 2025
1 check passed
@jackkleeman
jackkleeman deleted the fix-rs-ownership branch August 27, 2025 14:35
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant