Skip to content

(bug) handle helm chart errors in pullmode#1725

Merged
gianlucam76 merged 1 commit intoprojectsveltos:mainfrom
gianlucam76:helm-chart-error-pullmode
Apr 19, 2026
Merged

(bug) handle helm chart errors in pullmode#1725
gianlucam76 merged 1 commit intoprojectsveltos:mainfrom
gianlucam76:helm-chart-error-pullmode

Conversation

@gianlucam76
Copy link
Copy Markdown
Member

Previously, when Sveltos processed a Helm chart in pull mode, it would generate ConfigurationBundle instances as it prepared the resources. If an error was encountered halfway through this process, Sveltos would still commit the resources it had successfully prepared up to that point.

This led to a critical synchronization failure:

  1. Partial State: The ConfigurationBundle contained only a subset of the intended resources.
  2. Applier Misinterpretation: The applier would treat the missing resources as "deleted" or "out of scope," causing it to prune existing resources on the managed cluster or deploy an incomplete, broken stack.

This PR introduces atomic preparation logic. If an error occurs at any point during the preparation of resources for a Helm chart:

  1. Discard: All partially prepared resources are discarded.
  2. No Commit: Nothing is committed to the ConfigurationBundle, ensuring the applier does not act on incomplete data.
  3. Report: The error is captured and reported specifically within the ClusterSummary status for visibility.

Fixes #1724

@gianlucam76 gianlucam76 force-pushed the helm-chart-error-pullmode branch from 8b3a17e to 9f906a3 Compare April 18, 2026 20:28
@gianlucam76
Copy link
Copy Markdown
Member Author

ClusterSummary Status

    featureSummaries:
    - consecutiveFailures: 35
      failureMessage: |
        values don't meet the specifications of the schema(s) in the following chart(s):
        cert-manager:
        - at '/crds': additional properties 'replicas' not allowed
      featureID: Helm
      hash: B2G6wtbQhKUtF0v+KHC5r7qxVhltPre/I36fvFGtwMk=
      lastAppliedTime: "2026-04-18T20:28:36Z"
      status: Failed
    helmReleaseSummaries:
    - failureMessage: |
        values don't meet the specifications of the schema(s) in the following chart(s):
        cert-manager:
        - at '/crds': additional properties 'replicas' not allowed
      releaseName: cert-manager
      releaseNamespace: cert-manager
      status: Managing
      valuesHash: uHgnUljrEBsWynaXJjcLt0c5djSe1eNQ7xiaoopttaE=
    nextReconcileTime: "2026-04-18T20:29:36Z"

all resources are still on the managed cluster

@gianlucam76 gianlucam76 force-pushed the helm-chart-error-pullmode branch 2 times, most recently from f3f0944 to 63479b2 Compare April 19, 2026 05:46
Previously, when Sveltos processed a Helm chart in pull mode, it would
generate ConfigurationBundle instances as it prepared the resources.
If an error was encountered halfway through this process, Sveltos would
still commit the resources it had successfully prepared up to that point.

This led to a critical synchronization failure:

1. Partial State: The ConfigurationBundle contained only a subset of the
intended resources.
2. Applier Misinterpretation: The applier would treat the missing resources
as "deleted" or "out of scope," causing it to prune existing resources on the
managed cluster or deploy an incomplete, broken stack.

This PR introduces atomic preparation logic. If an error occurs at any point
during the preparation of resources for a Helm chart:

1. Discard: All partially prepared resources are discarded.
2. No Commit: Nothing is committed to the ConfigurationBundle, ensuring the
applier does not act on incomplete data.
3. Report: The error is captured and reported specifically within the ClusterSummary
status for visibility.
@gianlucam76 gianlucam76 force-pushed the helm-chart-error-pullmode branch from 63479b2 to e8bb8b6 Compare April 19, 2026 07:16
@gianlucam76 gianlucam76 merged commit f54a8de into projectsveltos:main Apr 19, 2026
8 checks passed
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.

BUG: Updating a chart in pull mode completely removes deployed artifacts

1 participant