Unverified Commit 0b4c60b7 authored by Matt Butcher's avatar Matt Butcher
Browse files

fix(helm): add --devel flag to allow dev releases again

2.4.0 stopped installing development versions by default. This allows
the user to re-enable that support by setting --devel.

Closes #2407
No related merge requests found
Showing with 43 additions and 17 deletions
+43 -17
......@@ -55,6 +55,8 @@ type fetchCmd struct {
verifyLater bool
keyring string
devel bool
out io.Writer
}
......@@ -69,6 +71,12 @@ func newFetchCmd(out io.Writer) *cobra.Command {
if len(args) == 0 {
return fmt.Errorf("This command needs at least one argument, url or repo/name of the chart.")
}
if fch.version == "" && fch.devel {
debug("setting version to >0.0.0-a")
fch.version = ">0.0.0-a"
}
for i := 0; i < len(args); i++ {
fch.chartRef = args[i]
if err := fch.run(); err != nil {
......@@ -87,6 +95,7 @@ func newFetchCmd(out io.Writer) *cobra.Command {
f.StringVar(&fch.version, "version", "", "specific version of a chart. Without this, the latest version is fetched")
f.StringVar(&fch.keyring, "keyring", defaultKeyring(), "keyring containing public keys")
f.StringVarP(&fch.destdir, "destination", "d", ".", "location to write the chart. If this and tardir are specified, tardir is appended to this")
f.BoolVar(&fch.devel, "devel", false, "use development versions, too. Equivalent to version '>0.0.0-a'. If --version is set, this is ignored.")
return cmd
}
......
......@@ -115,6 +115,7 @@ type installCmd struct {
version string
timeout int64
wait bool
devel bool
}
type valueFiles []string
......@@ -149,7 +150,14 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command {
if err := checkArgsLength(len(args), "chart name"); err != nil {
return err
}
debug("Original chart version: %q", inst.version)
if inst.version == "" && inst.devel {
debug("setting version to >0.0.0-a")
inst.version = ">0.0.0-a"
}
cp, err := locateChartPath(args[0], inst.version, inst.verify, inst.keyring)
if err != nil {
return err
}
......@@ -173,6 +181,7 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command {
f.StringVar(&inst.version, "version", "", "specify the exact chart version to install. If this is not specified, the latest version is installed")
f.Int64Var(&inst.timeout, "timeout", 300, "time in seconds to wait for any individual kubernetes operation (like Jobs for hooks)")
f.BoolVar(&inst.wait, "wait", false, "if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout")
f.BoolVar(&inst.devel, "devel", false, "use development versions, too. Equivalent to version '>0.0.0-a'. If --version is set, this is ignored.")
return cmd
}
......
......@@ -74,6 +74,7 @@ type upgradeCmd struct {
resetValues bool
reuseValues bool
wait bool
devel bool
}
func newUpgradeCmd(client helm.Interface, out io.Writer) *cobra.Command {
......@@ -93,6 +94,11 @@ func newUpgradeCmd(client helm.Interface, out io.Writer) *cobra.Command {
return err
}
if upgrade.version == "" && upgrade.devel {
debug("setting version to >0.0.0-a")
upgrade.version = ">0.0.0-a"
}
upgrade.release = args[0]
upgrade.chart = args[1]
upgrade.client = ensureHelmClient(upgrade.client)
......@@ -117,6 +123,7 @@ func newUpgradeCmd(client helm.Interface, out io.Writer) *cobra.Command {
f.BoolVar(&upgrade.resetValues, "reset-values", false, "when upgrading, reset the values to the ones built into the chart")
f.BoolVar(&upgrade.reuseValues, "reuse-values", false, "when upgrading, reuse the last release's values, and merge in any new values. If '--reset-values' is specified, this is ignored.")
f.BoolVar(&upgrade.wait, "wait", false, "if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout")
f.BoolVar(&upgrade.devel, "devel", false, "use development versions, too. Equivalent to version '>0.0.0-a'. If --version is set, this is ignored.")
f.MarkDeprecated("disable-hooks", "use --no-hooks instead")
......
......@@ -66,4 +66,4 @@ Environment:
* [helm verify](helm_verify.md) - verify that a chart at the given path has been signed and is valid
* [helm version](helm_version.md) - print the client/server version information
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -34,4 +34,4 @@ helm completion SHELL
### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -53,4 +53,4 @@ helm create NAME
### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -44,4 +44,4 @@ helm delete [flags] RELEASE_NAME [...]
### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -70,4 +70,4 @@ for this case.
* [helm dependency list](helm_dependency_list.md) - list the dependencies for the given chart
* [helm dependency update](helm_dependency_update.md) - update charts/ based on the contents of requirements.yaml
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -40,4 +40,4 @@ helm dependency build [flags] CHART
### SEE ALSO
* [helm dependency](helm_dependency.md) - manage a chart's dependencies
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -32,4 +32,4 @@ helm dependency list [flags] CHART
### SEE ALSO
* [helm dependency](helm_dependency.md) - manage a chart's dependencies
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -45,4 +45,4 @@ helm dependency update [flags] CHART
### SEE ALSO
* [helm dependency](helm_dependency.md) - manage a chart's dependencies
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -28,6 +28,7 @@ helm fetch [flags] [chart URL | repo/chartname] [...]
```
-d, --destination string location to write the chart. If this and tardir are specified, tardir is appended to this (default ".")
--devel use development versions, too. Equivalent to version '>0.0.0-a'. If --version is set, this is ignored.
--keyring string keyring containing public keys (default "~/.gnupg/pubring.gpg")
--prov fetch the provenance file, but don't perform verification
--untar if set to true, will untar the chart after downloading it
......@@ -49,4 +50,4 @@ helm fetch [flags] [chart URL | repo/chartname] [...]
### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -49,4 +49,4 @@ helm get [flags] RELEASE_NAME
* [helm get manifest](helm_get_manifest.md) - download the manifest for a named release
* [helm get values](helm_get_values.md) - download the values file for a named release
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -34,4 +34,4 @@ helm get hooks [flags] RELEASE_NAME
### SEE ALSO
* [helm get](helm_get.md) - download a named release
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -36,4 +36,4 @@ helm get manifest [flags] RELEASE_NAME
### SEE ALSO
* [helm get](helm_get.md) - download a named release
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -33,4 +33,4 @@ helm get values [flags] RELEASE_NAME
### SEE ALSO
* [helm get](helm_get.md) - download a named release
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -49,4 +49,4 @@ helm history [flags] RELEASE_NAME
### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -27,4 +27,4 @@ helm home
### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -63,4 +63,4 @@ helm init
### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 1-May-2017
###### Auto generated by spf13/cobra on 17-May-2017
......@@ -39,4 +39,4 @@ helm inspect [CHART]
* [helm inspect chart](helm_inspect_chart.md) - shows inspect chart
* [helm inspect values](helm_inspect_values.md) - shows inspect values
###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment