feat: Smooth ClusterProfile/Profile transitions - #1951
Merged
Conversation
Introduces a __TransitionFrom__ field to `ClusterProfile`/`Profile` to allow a successor profile to declare its predecessor. When migrating a cluster between profiles via a label swap, shared resources are taken over in place—eliminating the unnecessary teardown and re-deployment cycle. Currently, moving a cluster from ClusterProfile1 to ClusterProfile2 via a label swap forces a full tear-down-then-build lifecycle. ClusterProfile1 undeploys all of its managed resources before ClusterProfile2 begins deploying. Even for resources shared or identically configured between both profiles. Example: Changing a cluster's label from sbom: v1 (matching ClusterProfile1) to sbom: v2 (matching ClusterProfile2) triggers a complete undeployment of ClusterProfile1's resources before ClusterProfile2 deploys its workload. - **API Spec**: add `TransitionFrom` field to profile spec. - **Defer predecessor teardown until the successor is ready**: hold off on deleting the old profile's resources until the new profile is fully up and running. To avoid timing issues caused by parallel updates, code check the cluster's labels directly to identify the incoming profile rather than waiting for it to register in the system. If multiple new profiles are taking over, wait until all of them are ready before removing the old one. - **Let the successor win the resource-ownership conflict**: a second, tier-independent path to "takeover allowed" when the resource's current owner is named in the claiming profile's `TransitionFrom`. - **Same for Helm**: a mirrored bypass against `chartmanager`'s tier check, since Helm ownership is a separate subsystem from raw-resource ownership. - **Pull mode**: `TransitionFrom` staged onto `ConfigurationGroup` so `sveltos-applier` can grant the same takeover locally.
gianlucam76
force-pushed
the
transition
branch
from
September 9, 2026 06:53
e1eb6f3 to
97bb5f1
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.
Introduces a TransitionFrom field to
ClusterProfile/Profileto allow a successor profile to declare its predecessor.When migrating a cluster between profiles via a label swap, shared resources are taken over in place—eliminating the unnecessary teardown and re-deployment cycle.
Currently, moving a cluster from ClusterProfile1 to ClusterProfile2 via a label swap forces a full tear-down-then-build lifecycle. ClusterProfile1 undeploys all of its managed resources before ClusterProfile2 begins deploying. Even for resources shared or identically configured between both profiles.
Example: Changing a cluster's label from sbom: v1 (matching ClusterProfile1) to sbom: v2 (matching ClusterProfile2) triggers a complete undeployment of ClusterProfile1's resources before ClusterProfile2 deploys its workload.
TransitionFromfield to profile spec.TransitionFrom.chartmanager's tier check, since Helm ownership is a separate subsystem from raw-resource ownership.TransitionFromstaged ontoConfigurationGroupsosveltos-appliercan grant the same takeover locally.Fixes #1949