Skip to content

Allow diff to include crds #762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Flags:
--skip-schema-validation disables rendered templates validation against the Kubernetes OpenAPI Schema
-D, --find-renames float32 Enable rename detection if set to any value greater than 0. If specified, the value denotes the maximum fraction of changed content as lines added + removed compared to total lines in a diff for considering it a rename. Only objects of the same Kind are attempted to be matched
-h, --help help for diff
--include-crds include CRDs in the diffing
--include-tests enable the diffing of the helm test hooks
--install enables diffing of releases that are not yet deployed via Helm (equivalent to --allow-unreleased, added to match "helm upgrade --install" command
--kube-version string Kubernetes version used for Capabilities.KubeVersion
Expand Down Expand Up @@ -189,6 +190,7 @@ Flags:
--skip-schema-validation skip validation of rendered templates against the Kubernetes OpenAPI Schema
-D, --find-renames float32 Enable rename detection if set to any value greater than 0. If specified, the value denotes the maximum fraction of changed content as lines added + removed compared to total lines in a diff for considering it a rename. Only objects of the same Kind are attempted to be matched
-h, --help help for upgrade
--include-crds include CRDs in the diffing
--include-tests enable the diffing of the helm test hooks
--install enables diffing of releases that are not yet deployed via Helm (equivalent to --allow-unreleased, added to match "helm upgrade --install" command
--kube-version string Kubernetes version used for Capabilities.KubeVersion
Expand Down
3 changes: 3 additions & 0 deletions cmd/helm3.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ func (d *diffCmd) template(isUpgrade bool) ([]byte, error) {
if d.noHooks && !d.useUpgradeDryRun {
flags = append(flags, "--no-hooks")
}
if d.includeCRDs {
flags = append(flags, "--include-crds")
}
if d.chartVersion != "" {
flags = append(flags, "--version", d.chartVersion)
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type diffCmd struct {
allowUnreleased bool
noHooks bool
includeTests bool
includeCRDs bool
postRenderer string
postRendererArgs []string
insecureSkipTLSVerify bool
Expand Down Expand Up @@ -241,6 +242,7 @@ func newChartCommand() *cobra.Command {
f.BoolVar(&diff.install, "install", false, "enables diffing of releases that are not yet deployed via Helm (equivalent to --allow-unreleased, added to match \"helm upgrade --install\" command")
f.BoolVar(&diff.noHooks, "no-hooks", false, "disable diffing of hooks")
f.BoolVar(&diff.includeTests, "include-tests", false, "enable the diffing of the helm test hooks")
f.BoolVar(&diff.includeCRDs, "include-crds", false, "include CRDs in the diffing")
f.BoolVar(&diff.devel, "devel", false, "use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.")
f.BoolVar(&diff.disableValidation, "disable-validation", false, "disables rendered templates validation against the Kubernetes cluster you are currently pointing to. This is the same validation performed on an install")
f.BoolVar(&diff.disableOpenAPIValidation, "disable-openapi-validation", false, "disables rendered templates validation against the Kubernetes OpenAPI Schema")
Expand Down
Loading