Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions controllers/handlers_helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,21 @@ func handleCharts(ctx context.Context, clusterSummary *configv1beta1.ClusterSumm
}

if isPullMode {
// If any chart in this reconcile failed to stage (helm values schema
// error, template instantiation failure, unreachable repo, etc.),
// do not commit. Committing a partial staged set produces a
// ConfigurationGroup with missing bundles for the failed charts,
// which the agent in the managed cluster interprets as "these
// releases were removed from the profile" and uninstalls them.
// Returning early leaves the previously-committed ConfigurationGroup
// in place so the agent continues to run the last known good state
// until the reconcile can complete cleanly. This mirrors the
// deployError-before-commit pattern already used in
// handlers_resources.go and handlers_kustomize.go.
if deployError != nil {
return deployError
}

err = commitStagedResourcesForDeployment(ctx, clusterSummary, configurationHash, mgmtResources, logger)
if err != nil {
return err
Expand All @@ -937,10 +952,6 @@ func handleCharts(ctx context.Context, clusterSummary *configv1beta1.ClusterSumm
if err != nil {
return err
}

if deployError != nil {
return deployError
}
} else {
// First get the helm releases currently managed and uninstall all the ones
// not referenced anymore. Only if this operation succeeds, removes all stale
Expand Down
Loading