Skip to content

Commit a69b500

Browse files
authored
Merge pull request #92 from sstarcher/devel_upgrade
add --devel flag support
2 parents 887ad5c + 972b4c1 commit a69b500

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
namespace string // namespace to assume the release to be installed into. Defaults to the current kube config namespace.
2224
valueFiles valueFiles
2325
values []string
@@ -78,6 +80,7 @@ func newChartCommand() *cobra.Command {
7880
f.BoolVar(&diff.reuseValues, "reuse-values", false, "reuse the last release's values and merge in any new values")
7981
f.BoolVar(&diff.resetValues, "reset-values", false, "reset the values to the ones built into the chart and merge in any new values")
8082
f.BoolVar(&diff.allowUnreleased, "allow-unreleased", false, "enables diffing of releases that are not yet deployed via Helm")
83+
f.BoolVar(&diff.devel, "devel", false, "use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored.")
8184
f.StringArrayVar(&diff.suppressedKinds, "suppress", []string{}, "allows suppression of the values listed in the diff output")
8285
f.IntVarP(&diff.outputContext, "context", "C", -1, "output NUM lines of context around changes")
8386
f.StringVar(&diff.namespace, "namespace", "default", "namespace to assume the release to be installed into")
@@ -89,6 +92,10 @@ func newChartCommand() *cobra.Command {
8992
}
9093

9194
func (d *diffCmd) run() error {
95+
if d.chartVersion == "" && d.devel {
96+
d.chartVersion = ">0.0.0-0"
97+
}
98+
9299
chartPath, err := locateChartPath(d.chart, d.chartVersion, false, "")
93100
if err != nil {
94101
return err

0 commit comments

Comments
 (0)