Clean up orphaned drift-detection version ConfigMaps - #1935
Merged
gianlucam76 merged 1 commit intoAug 30, 2026
Merged
Conversation
removeStaleDriftDetectionResources already deletes the ResourceSummary instances and the drift-detection-manager deployment for a cluster once it's gone, but left the per-cluster version-tracking ConfigMap behind forever since nothing else owns it. Delete it too, after the deployment so drift-detection-manager isn't still around to recreate it. Needs the delete verb on configmaps, which the manager didn't have before since it never mutated them.
gianlucam76
added a commit
that referenced
this pull request
Aug 30, 2026
) removeStaleDriftDetectionResources already deletes the ResourceSummary instances and the drift-detection-manager deployment for a cluster once it's gone, but left the per-cluster version-tracking ConfigMap behind forever since nothing else owns it. Delete it too, after the deployment so drift-detection-manager isn't still around to recreate it. Needs the delete verb on configmaps, which the manager didn't have before since it never mutated them. Co-authored-by: Matt Pryor <matt.pryor@nscale.com>
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
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.
Companion to projectsveltos/libsveltos#671 and projectsveltos/classifier's matching PR - the three together follow gianlucam76's preferred approach from libsveltos#670, rather than the owner-reference version.
The drift-detection-manager version ConfigMap that gets created per-cluster in agentless mode has no owner and no cleanup path, so it sits around forever once the cluster it tracks is deleted.
removeStaleDriftDetectionResourcesalready tears down the ResourceSummary instances and the deployment for a gone cluster, so this just adds the ConfigMap to that same cleanup, using the newDeleteDriftDetectionVersionfrom libsveltos.The delete happens after the deployment, not before: drift-detection-manager is what writes this ConfigMap, and it's still running right up until the deployment goes away, so deleting the ConfigMap first risks it coming right back before the deployment is actually gone.
Needs a libsveltos version pinned that includes DeleteDriftDetectionVersion; happy to update the pin once that's tagged rather than the commit pseudo-version this currently uses.