Skip to content

Commit b24161d

Browse files
Merge pull request #1 from databus23/master
Expose post-renderer flag in the upgrade subcommand (databus23#196)
2 parents 5018bd7 + 8175484 commit b24161d

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Examples:
8181
Flags:
8282
-h, --help help for upgrade
8383
--detailed-exitcode return a non-zero exit code when there are changes
84+
--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
8485
--reset-values reset the values to the ones built into the chart and merge in any new values
8586
--reuse-values reuse the last release's values and merge in any new values
8687
--set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2)

cmd/helm3.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ func (d *diffCmd) template(isUpgrade bool) ([]byte, error) {
9595
if d.namespace != "" {
9696
flags = append(flags, "--namespace", d.namespace)
9797
}
98+
if d.postRenderer != "" {
99+
flags = append(flags, "--post-renderer", d.postRenderer)
100+
}
98101
// Helm automatically enable --reuse-values when there's no --set, --set-string, --set-values, --set-file present.
99102
// Let's simulate that in helm-diff.
100103
// See https://medium.com/@kcatstack/understand-helm-upgrade-flags-reset-values-reuse-values-6e58ac8f127e

cmd/upgrade.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type diffCmd struct {
3333
suppressedKinds []string
3434
outputContext int
3535
showSecrets bool
36+
postRenderer string
3637
}
3738

3839
const globalUsage = `Show a diff explaining what a helm upgrade would change.
@@ -96,6 +97,7 @@ func newChartCommand() *cobra.Command {
9697
f.BoolVar(&diff.devel, "devel", false, "use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.")
9798
f.StringArrayVar(&diff.suppressedKinds, "suppress", []string{}, "allows suppression of the values listed in the diff output")
9899
f.IntVarP(&diff.outputContext, "context", "C", -1, "output NUM lines of context around changes")
100+
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")
99101
if !isHelm3() {
100102
f.StringVar(&diff.namespace, "namespace", "default", "namespace to assume the release to be installed into")
101103
}

0 commit comments

Comments
 (0)