Skip to content

Clean up orphaned drift-detection version ConfigMaps - #1935

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
nscaledev:mattpryor/cleanup-driftdetection-configmap
Aug 30, 2026
Merged

Clean up orphaned drift-detection version ConfigMaps#1935
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
nscaledev:mattpryor/cleanup-driftdetection-configmap

Conversation

@mkjpryor

Copy link
Copy Markdown
Contributor

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. removeStaleDriftDetectionResources already tears down the ResourceSummary instances and the deployment for a gone cluster, so this just adds the ConfigMap to that same cleanup, using the new DeleteDriftDetectionVersion from 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.

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 gianlucam76 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@gianlucam76
gianlucam76 merged commit 4441914 into projectsveltos:main Aug 30, 2026
19 of 20 checks passed
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>
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.

2 participants