diff --git a/README.md b/README.md index 85e6a8d4..a02d0626 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ Examples: Flags: -h, --help help for upgrade --detailed-exitcode return a non-zero exit code when there are changes + --post-renderer string the path to an executable to be used for post rendering. If it exists in $PATH, the binary will be used, otherwise it will try to look for the executable at the given path --reset-values reset the values to the ones built into the chart and merge in any new values --reuse-values reuse the last release's values and merge in any new values --set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) diff --git a/cmd/helm3.go b/cmd/helm3.go index 52f86bbc..02ba22c8 100644 --- a/cmd/helm3.go +++ b/cmd/helm3.go @@ -95,6 +95,9 @@ func (d *diffCmd) template(isUpgrade bool) ([]byte, error) { if d.namespace != "" { flags = append(flags, "--namespace", d.namespace) } + if d.postRenderer != "" { + flags = append(flags, "--post-renderer", d.postRenderer) + } // Helm automatically enable --reuse-values when there's no --set, --set-string, --set-values, --set-file present. // Let's simulate that in helm-diff. // See https://medium.com/@kcatstack/understand-helm-upgrade-flags-reset-values-reuse-values-6e58ac8f127e diff --git a/cmd/upgrade.go b/cmd/upgrade.go index 1956b97b..8ede5d5a 100644 --- a/cmd/upgrade.go +++ b/cmd/upgrade.go @@ -33,6 +33,7 @@ type diffCmd struct { suppressedKinds []string outputContext int showSecrets bool + postRenderer string } const globalUsage = `Show a diff explaining what a helm upgrade would change. @@ -96,6 +97,7 @@ func newChartCommand() *cobra.Command { 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.StringArrayVar(&diff.suppressedKinds, "suppress", []string{}, "allows suppression of the values listed in the diff output") f.IntVarP(&diff.outputContext, "context", "C", -1, "output NUM lines of context around changes") + f.StringVar(&diff.postRenderer, "post-renderer", "", "the path to an executable to be used for post rendering. If it exists in $PATH, the binary will be used, otherwise it will try to look for the executable at the given path") if !isHelm3() { f.StringVar(&diff.namespace, "namespace", "default", "namespace to assume the release to be installed into") }