Skip to content

feat: Report drifted resources in ClusterSummary - #2024

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:drift-resource-identity
Oct 8, 2026
Merged

gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:drift-resource-identity

Conversation

@gianlucam76

Copy link
Copy Markdown
Member

Fixes #1940

Two changes that go together: say which resources drifted, and give pull mode the same per-chart behavior as push mode.

drift-detection now lists the drifted resources in ResourceSummary.status.driftedResources. addon-controller records them in the ClusterSummary:

  • New FeatureSummary.lastDrift: detectedTime, the drifted resources (group, kind, namespace, name, and for Helm the release name and namespace), and a truncated flag when more than 20 drifted.
  • Kept after the drift is corrected and replaced by the next drift. Only set for ContinuousWithDriftDetection.
  • After a drift is recorded, driftedResources and driftedResourcesTruncated are cleared on the ResourceSummary. drift-detection only appends and skips a resource already listed, so without this the detectedTime stays pinned to the first drift.

In pull mode every chart of a profile was staged and re-applied by sveltos-applier on any change or drift. Now:

  • HelmChartSummary tracks appliedContentHash (what sveltos-applier last confirmed as applied) and stagedContentHash (staged, not yet confirmed). The hash covers the rendered resources and the settings that change how they are applied.
  • A chart whose hash matches the applied one, and that drift-detection did not report, is staged with ConfigurationBundle skipApply, so sveltos-applier leaves it alone. Skipped bundles are still reported, so the applier's cleanup and ResourceSummary stay correct.
  • A chart is never skipped while a staged hash is pending, so a failed apply is retried.
  • A chart staged because it yielded to a lower tier profile is always applied: that is how the owner tier is updated on its resources.
  • Push mode is unchanged.

@gianlucam76
gianlucam76 force-pushed the drift-resource-identity branch from 1ed671f to 7ace0d8 Compare October 8, 2026 17:54
Fixes projectsveltos#1940

Two changes that go together: say which resources drifted, and give pull mode the same per-chart
behavior as push mode.

drift-detection now lists the drifted resources in ResourceSummary.status.driftedResources.
addon-controller records them in the ClusterSummary:

- New FeatureSummary.lastDrift: detectedTime, the drifted resources (group, kind, namespace, name,
and for Helm the release name and namespace), and a truncated flag when more than 20 drifted.
- Kept after the drift is corrected and replaced by the next drift. Only set for ContinuousWithDriftDetection.
- After a drift is recorded, driftedResources and driftedResourcesTruncated are cleared on the ResourceSummary.
drift-detection only appends and skips a resource already listed, so without this the detectedTime stays pinned to the first drift.

In pull mode every chart of a profile was staged and re-applied by sveltos-applier on any change or drift. Now:

- HelmChartSummary tracks appliedContentHash (what sveltos-applier last confirmed as applied) and stagedContentHash
(staged, not yet confirmed). The hash covers the rendered resources and the settings that change how they are applied.
- A chart whose hash matches the applied one, and that drift-detection did not report, is staged with ConfigurationBundle
skipApply, so sveltos-applier leaves it alone. Skipped bundles are still reported, so the applier's cleanup and ResourceSummary
stay correct.
- A chart is never skipped while a staged hash is pending, so a failed apply is retried.
- A chart staged because it yielded to a lower tier profile is always applied: that is how the owner tier is updated on its resources.
- Push mode is unchanged.
@gianlucam76
gianlucam76 force-pushed the drift-resource-identity branch from 7ace0d8 to f8e092b Compare October 8, 2026 18:30
@gianlucam76
gianlucam76 merged commit 60bea84 into projectsveltos:main Oct 8, 2026
12 checks passed
@gianlucam76
gianlucam76 deleted the drift-resource-identity branch October 8, 2026 19:08
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.

Pull mode redeploys every Helm chart in a ClusterSummary when only one changed or drifted

1 participant