Repository navigation
feat: installOptions.existingCRDs controls CRDs already present on helm install - #2044
Merged
Merged
Conversation
…lm install (projectsveltos#2041) On a fresh install the chart's crds/ were applied with server-side apply and force conflicts, silently overwriting (and possibly downgrading) CRDs that already existed in the cluster. This contradicts the SkipCRDs documentation ("installed if not already present") and Helm's own behavior for crds/. Before helm install, create the CRDs of the chart (subcharts included) that are missing and tell Helm to skip its own CRD step. An existing CRD is never modified. Whether it differs from the chart's is decided with a server-side apply dry run. The new installOptions.existingCRDs field selects what to do with a differing one: - Skip (default): leave it as it is, log it and carry on - Fail: fail the installation naming the CRDs, creating nothing - Overwrite: previous behavior, Helm applies the chart's CRD skipCRDs, DryRun and template-only runs are unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…veltos#2041) A fresh install of a chart whose crds/ already exist in the cluster with a different definition now fails by default and reports the CRDs that differ, so Sveltos never decides on behalf of the user whether to keep or replace a CRD that may be owned by another tool. It matches what Helm 4 does by default when the existing CRD has conflicting fields. Users choose explicitly with installOptions.existingCRDs: - Skip: leave the existing CRDs as they are and carry on - Overwrite: apply the chart's CRDs over the existing ones Releases that are already deployed are not affected, only fresh installs go through this step.
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.
On a fresh install the chart's crds/ were applied with server-side apply and force conflicts, silently overwriting (and possibly downgrading) CRDs that already existed in the cluster. This contradicts the SkipCRDs documentation ("installed if not already present") and Helm's own behavior for crds/.
Before helm install, create the CRDs of the chart (subcharts included) that are missing and tell Helm to skip its own CRD step. An existing CRD is never modified. Whether it differs from the chart's is decided with a server-side apply dry run. The new installOptions.existingCRDs field selects what to do with a differing one:
skipCRDs, DryRun and template-only runs are unchanged.
Fixes #2041