Skip to content

Commit

Permalink
fix(helm): add --devel flag to allow dev releases again
Browse files Browse the repository at this point in the history
2.4.0 stopped installing development versions by default. This allows
the user to re-enable that support by setting --devel.

Closes helm#2407
  • Loading branch information
technosophos committed May 17, 2017
1 parent 7e82a07 commit 7031958
Show file tree
Hide file tree
Showing 91 changed files with 262 additions and 216 deletions.
9 changes: 9 additions & 0 deletions cmd/helm/fetch.go
Expand Up @@ -61,6 +61,8 @@ type fetchCmd struct {
keyFile string
caFile string

devel bool

out io.Writer
}

Expand All @@ -75,6 +77,12 @@ func newFetchCmd(out io.Writer) *cobra.Command {
if len(args) == 0 {
return fmt.Errorf("need 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 {
Expand All @@ -97,6 +105,7 @@ func newFetchCmd(out io.Writer) *cobra.Command {
f.StringVar(&fch.certFile, "cert-file", "", "identify HTTPS client using this SSL certificate file")
f.StringVar(&fch.keyFile, "key-file", "", "identify HTTPS client using this SSL key file")
f.StringVar(&fch.caFile, "ca-file", "", "verify certificates of HTTPS-enabled servers using this CA bundle")
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
}
Expand Down
9 changes: 9 additions & 0 deletions cmd/helm/install.go
Expand Up @@ -117,6 +117,7 @@ type installCmd struct {
timeout int64
wait bool
repoURL string
devel bool

certFile string
keyFile string
Expand Down Expand Up @@ -155,6 +156,13 @@ 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(inst.repoURL, args[0], inst.version, inst.verify, inst.keyring,
inst.certFile, inst.keyFile, inst.caFile)
if err != nil {
Expand Down Expand Up @@ -184,6 +192,7 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command {
f.StringVar(&inst.certFile, "cert-file", "", "identify HTTPS client using this SSL certificate file")
f.StringVar(&inst.keyFile, "key-file", "", "identify HTTPS client using this SSL key file")
f.StringVar(&inst.caFile, "ca-file", "", "verify certificates of HTTPS-enabled servers using this CA bundle")
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
}
Expand Down
7 changes: 7 additions & 0 deletions cmd/helm/upgrade.go
Expand Up @@ -75,6 +75,7 @@ type upgradeCmd struct {
reuseValues bool
wait bool
repoURL string
devel bool

certFile string
keyFile string
Expand All @@ -98,6 +99,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)
Expand Down Expand Up @@ -126,6 +132,7 @@ func newUpgradeCmd(client helm.Interface, out io.Writer) *cobra.Command {
f.StringVar(&upgrade.certFile, "cert-file", "", "identify HTTPS client using this SSL certificate file")
f.StringVar(&upgrade.keyFile, "key-file", "", "identify HTTPS client using this SSL key file")
f.StringVar(&upgrade.caFile, "ca-file", "", "verify certificates of HTTPS-enabled servers using this CA bundle")
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")

Expand Down
4 changes: 2 additions & 2 deletions docs/helm/helm.md
Expand Up @@ -33,7 +33,7 @@ Environment:

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_completion.md
Expand Up @@ -25,7 +25,7 @@ helm completion SHELL

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_create.md
Expand Up @@ -44,7 +44,7 @@ helm create NAME

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_delete.md
Expand Up @@ -35,7 +35,7 @@ helm delete [flags] RELEASE_NAME [...]

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_dependency.md
Expand Up @@ -58,7 +58,7 @@ for this case.

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_dependency_build.md
Expand Up @@ -31,7 +31,7 @@ helm dependency build [flags] CHART

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_dependency_list.md
Expand Up @@ -23,7 +23,7 @@ helm dependency list [flags] CHART

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_dependency_update.md
Expand Up @@ -36,7 +36,7 @@ helm dependency update [flags] CHART

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
5 changes: 3 additions & 2 deletions docs/helm/helm_fetch.md
Expand Up @@ -30,6 +30,7 @@ helm fetch [flags] [chart URL | repo/chartname] [...]
--ca-file string verify certificates of HTTPS-enabled servers using this CA bundle
--cert-file string identify HTTPS client using this SSL certificate file
-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.
--key-file string identify HTTPS client using this SSL key file
--keyring string keyring containing public keys (default "~/.gnupg/pubring.gpg")
--prov fetch the provenance file, but don't perform verification
Expand All @@ -44,7 +45,7 @@ helm fetch [flags] [chart URL | repo/chartname] [...]

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -53,4 +54,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 24-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
4 changes: 2 additions & 2 deletions docs/helm/helm_get.md
Expand Up @@ -37,7 +37,7 @@ helm get [flags] RELEASE_NAME

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_get_hooks.md
Expand Up @@ -25,7 +25,7 @@ helm get hooks [flags] RELEASE_NAME

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_get_manifest.md
Expand Up @@ -27,7 +27,7 @@ helm get manifest [flags] RELEASE_NAME

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_get_values.md
Expand Up @@ -24,7 +24,7 @@ helm get values [flags] RELEASE_NAME

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_history.md
Expand Up @@ -40,7 +40,7 @@ helm history [flags] RELEASE_NAME

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_home.md
Expand Up @@ -18,7 +18,7 @@ helm home

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_init.md
Expand Up @@ -54,7 +54,7 @@ helm init

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -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
4 changes: 2 additions & 2 deletions docs/helm/helm_inspect.md
Expand Up @@ -32,7 +32,7 @@ helm inspect [CHART]

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -43,4 +43,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 24-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
4 changes: 2 additions & 2 deletions docs/helm/helm_inspect_chart.md
Expand Up @@ -30,7 +30,7 @@ helm inspect chart [CHART]

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -39,4 +39,4 @@ helm inspect chart [CHART]
### SEE ALSO
* [helm inspect](helm_inspect.md) - inspect a chart

###### Auto generated by spf13/cobra on 24-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
4 changes: 2 additions & 2 deletions docs/helm/helm_inspect_values.md
Expand Up @@ -30,7 +30,7 @@ helm inspect values [CHART]

```
--debug enable verbose output
--home string location of your Helm config. Overrides $HELM_HOME (default "~/.helm")
--home string location of your Helm config. Overrides $HELM_HOME (default "~/HelmHome")
--host string address of tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use
--tiller-namespace string namespace of tiller (default "kube-system")
Expand All @@ -39,4 +39,4 @@ helm inspect values [CHART]
### SEE ALSO
* [helm inspect](helm_inspect.md) - inspect a chart

###### Auto generated by spf13/cobra on 24-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017

0 comments on commit 7031958

Please sign in to comment.