fix: cleanup of ClusterProfile with reloader knob set - #1898
Merged
Conversation
When a ClusterProfile with `spec.reloader: true` deploying Helm charts is deleted (or stops matching its target cluster), the corresponding `Reloader` instance and in agentless mode its entry in the per-cluster ConfigMap were never cleaned up. Both would sit around indefinitely, referencing Deployments from a chart that's no longer deployed. `undeployHelmChartResources` calls `updateReloaderWithDeployedResources` to remove the Reloader on undeploy, but passed `libsveltosv1beta1.FeatureKustomize` instead of `FeatureHelm` Because the Reloader is looked up by label (`feature: Helm`) and the per-cluster ConfigMap key is derived from the feature name, passing the wrong constant makes both lookups silently miss the real Reloader/ConfigMap entry. No error is raised, it's a silent no-op on both sides. This only affects Helm-based ClusterProfiles; Resources and Kustomize were never mis-tagged and clean up correctly, which is why this went unnoticed.
gianlucam76
force-pushed
the
reloader-cleanup
branch
from
July 29, 2026 16:17
e574325 to
bfb9c40
Compare
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.
When a ClusterProfile with
spec.reloader: truedeploying Helm charts is deleted (or stops matching its target cluster), the correspondingReloaderinstance and in agentless mode its entry in the per-cluster ConfigMap were never cleaned up. Both would sit around indefinitely, referencing Deployments from a chart that's no longer deployed.undeployHelmChartResourcescallsupdateReloaderWithDeployedResourcesto remove the Reloader on undeploy, but passedlibsveltosv1beta1.FeatureKustomizeinstead ofFeatureHelmBecause the Reloader is looked up by label (
feature: Helm) and the per-cluster ConfigMap key is derived from the feature name, passing the wrong constant makes both lookups silently miss the real Reloader/ConfigMap entry. No error is raised, it's a silent no-op on both sides. This only affects Helm-based ClusterProfiles; Resources and Kustomize were never mis-tagged and clean up correctly, which is why this went unnoticed.