diff --git a/README.md b/README.md index 7a1db62e..08a5db31 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/cmd/helm3.go b/cmd/helm3.go index 3990b60e..1e9df931 100644 --- a/cmd/helm3.go +++ b/cmd/helm3.go @@ -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) } diff --git a/cmd/upgrade.go b/cmd/upgrade.go index 74533679..75281af4 100644 --- a/cmd/upgrade.go +++ b/cmd/upgrade.go @@ -53,6 +53,7 @@ type diffCmd struct { allowUnreleased bool noHooks bool includeTests bool + includeCRDs bool postRenderer string postRendererArgs []string insecureSkipTLSVerify bool @@ -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")