Skip to content

Commit 3f35aea

Browse files
committed
add --devel flag support
1 parent c17ec6b commit 3f35aea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmd/upgrade.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"strings"
77

88
"errors"
9+
910
"github.com/databus23/helm-diff/diff"
1011
"github.com/databus23/helm-diff/manifest"
1112
"github.com/spf13/cobra"
@@ -18,6 +19,7 @@ type diffCmd struct {
1819
chartVersion string
1920
client helm.Interface
2021
detailedExitCode bool
22+
devel bool
2123
valueFiles valueFiles
2224
values []string
2325
reuseValues bool
@@ -75,6 +77,7 @@ func newChartCommand() *cobra.Command {
7577
f.BoolVar(&diff.reuseValues, "reuse-values", false, "reuse the last release's values and merge in any new values")
7678
f.BoolVar(&diff.resetValues, "reset-values", false, "reset the values to the ones built into the chart and merge in any new values")
7779
f.BoolVar(&diff.allowUnreleased, "allow-unreleased", false, "enables diffing of releases that are not yet deployed via Helm")
80+
f.BoolVar(&diff.devel, "devel", false, "use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.")
7881
f.StringArrayVar(&diff.suppressedKinds, "suppress", []string{}, "allows suppression of the values listed in the diff output")
7982
f.IntVarP(&diff.outputContext, "context", "C", -1, "output NUM lines of context around changes")
8083

@@ -85,6 +88,10 @@ func newChartCommand() *cobra.Command {
8588
}
8689

8790
func (d *diffCmd) run() error {
91+
if d.chartVersion == "" && d.devel {
92+
d.chartVersion = ">0.0.0-0"
93+
}
94+
8895
chartPath, err := locateChartPath(d.chart, d.chartVersion, false, "")
8996
if err != nil {
9097
return err

0 commit comments

Comments
 (0)