Skip to content

fix: uninstall Helm charts in reverse of install order - #1984

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:bug-1983
Sep 18, 2026
Merged

gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:bug-1983

Conversation

@gianlucam76

@gianlucam76 gianlucam76 commented Sep 18, 2026

Copy link
Copy Markdown
Member

When a profile contains multiple Helm charts, Sveltos installs them in the order they are listed. Previously, when a cluster stopped matching a profile, charts were uninstalled in that same forward order.

This PR updates the cleanup logic so that Helm charts are uninstalled in reverse order, ensuring correct dependency handling during removal.

While charts are properly uninstalled in reverse order when a cluster completely stops matching a profile, there is one scenario where the exact deletion order cannot be guaranteed: if a cluster remains matched to the profile, but charts 2 and 3 are actively removed from the profile's helmCharts section while chart 1 stays.

Fixes #1983

When a profile contains multiple Helm charts, Sveltos installs
them in the order they are listed. Previously, when a cluster
stopped matching a profile, charts were uninstalled in that
same forward order.

This PR updates the cleanup logic so that Helm charts are
uninstalled in reverse order, ensuring correct dependency
handling during removal.

While charts are properly uninstalled in reverse order when
a cluster completely stops matching a profile, there is one
scenario where the exact deletion order cannot be guaranteed:
if a cluster remains matched to the profile, but charts 2 and
3 are actively removed from the profile's helmCharts section
while chart 1 stays.
@gianlucam76
gianlucam76 merged commit 4b1bf20 into projectsveltos:main Sep 18, 2026
31 of 32 checks passed
@gianlucam76
gianlucam76 deleted the bug-1983 branch September 18, 2026 20:05
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.

Should Helm charts be uninstalled in reverse order?

1 participant