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 authored and flynnduism committed May 28, 2017
1 parent 3e30b4f commit e0379e1
Show file tree
Hide file tree
Showing 91 changed files with 173 additions and 127 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
2 changes: 1 addition & 1 deletion docs/helm/helm.md
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
2 changes: 1 addition & 1 deletion docs/helm/helm_completion.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_create.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_delete.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_dependency.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_dependency_build.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_dependency_list.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_dependency_update.md
Expand Up @@ -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
3 changes: 2 additions & 1 deletion 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 @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_get.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_get_hooks.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_get_manifest.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_get_values.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_history.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_home.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_init.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_inspect.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_inspect_chart.md
Expand Up @@ -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
2 changes: 1 addition & 1 deletion docs/helm/helm_inspect_values.md
Expand Up @@ -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
3 changes: 2 additions & 1 deletion docs/helm/helm_install.md
Expand Up @@ -70,6 +70,7 @@ helm install [CHART]
```
--ca-file string verify certificates of HTTPS-enabled servers using this CA bundle
--cert-file string identify HTTPS client using this SSL certificate file
--devel use development versions, too. Equivalent to version '>0.0.0-a'. If --version is set, this is ignored.
--dry-run simulate an install
--key-file string identify HTTPS client using this SSL key file
--keyring string location of public keys used for verification (default "~/.gnupg/pubring.gpg")
Expand Down Expand Up @@ -105,4 +106,4 @@ helm install [CHART]
### 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
2 changes: 1 addition & 1 deletion docs/helm/helm_lint.md
Expand Up @@ -37,4 +37,4 @@ helm lint [flags] PATH
### 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
2 changes: 1 addition & 1 deletion docs/helm/helm_list.md
Expand Up @@ -70,4 +70,4 @@ helm list [flags] [FILTER]
### 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
2 changes: 1 addition & 1 deletion docs/helm/helm_package.md
Expand Up @@ -44,4 +44,4 @@ helm package [flags] [CHART_PATH] [...]
### 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
2 changes: 1 addition & 1 deletion docs/helm/helm_plugin.md
Expand Up @@ -26,4 +26,4 @@ Manage client-side Helm plugins.
* [helm plugin remove](helm_plugin_remove.md) - remove one or more Helm plugins
* [helm plugin update](helm_plugin_update.md) - update one or more Helm plugins

###### Auto generated by spf13/cobra on 6-May-2017
###### Auto generated by spf13/cobra on 17-May-2017
2 changes: 1 addition & 1 deletion docs/helm/helm_plugin_install.md
Expand Up @@ -30,4 +30,4 @@ helm plugin install [options] <path|url>...
### SEE ALSO
* [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins

###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
2 changes: 1 addition & 1 deletion docs/helm/helm_plugin_list.md
Expand Up @@ -24,4 +24,4 @@ helm plugin list
### SEE ALSO
* [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins

###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
2 changes: 1 addition & 1 deletion docs/helm/helm_plugin_remove.md
Expand Up @@ -24,4 +24,4 @@ helm plugin remove <plugin>...
### SEE ALSO
* [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins

###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
2 changes: 1 addition & 1 deletion docs/helm/helm_plugin_update.md
Expand Up @@ -24,4 +24,4 @@ helm plugin update <plugin>...
### SEE ALSO
* [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins

###### Auto generated by spf13/cobra on 6-May-2017
###### Auto generated by spf13/cobra on 17-May-2017
2 changes: 1 addition & 1 deletion docs/helm/helm_repo.md
Expand Up @@ -31,4 +31,4 @@ Example usage:
* [helm repo remove](helm_repo_remove.md) - remove a chart repository
* [helm repo update](helm_repo_update.md) - update information on available charts in the chart repositories

###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
2 changes: 1 addition & 1 deletion docs/helm/helm_repo_add.md
Expand Up @@ -33,4 +33,4 @@ helm repo add [flags] [NAME] [URL]
### SEE ALSO
* [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories

###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
2 changes: 1 addition & 1 deletion docs/helm/helm_repo_index.md
Expand Up @@ -40,4 +40,4 @@ helm repo index [flags] [DIR]
### SEE ALSO
* [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories

###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
2 changes: 1 addition & 1 deletion docs/helm/helm_repo_list.md
Expand Up @@ -24,4 +24,4 @@ helm repo list [flags]
### SEE ALSO
* [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories

###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
2 changes: 1 addition & 1 deletion docs/helm/helm_repo_remove.md
Expand Up @@ -24,4 +24,4 @@ helm repo remove [flags] [NAME]
### SEE ALSO
* [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories

###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
2 changes: 1 addition & 1 deletion docs/helm/helm_repo_update.md
Expand Up @@ -30,4 +30,4 @@ helm repo update
### SEE ALSO
* [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories

###### Auto generated by spf13/cobra on 16-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
2 changes: 1 addition & 1 deletion docs/helm/helm_reset.md
Expand Up @@ -40,4 +40,4 @@ helm reset
### 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
2 changes: 1 addition & 1 deletion docs/helm/helm_rollback.md
Expand Up @@ -45,4 +45,4 @@ helm rollback [flags] [RELEASE] [REVISION]
### 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
2 changes: 1 addition & 1 deletion docs/helm/helm_search.md
Expand Up @@ -37,4 +37,4 @@ helm search [keyword]
### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes.

###### Auto generated by spf13/cobra on 18-Apr-2017
###### Auto generated by spf13/cobra on 17-May-2017
2 changes: 1 addition & 1 deletion docs/helm/helm_serve.md
Expand Up @@ -45,4 +45,4 @@ helm serve
### 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
2 changes: 1 addition & 1 deletion docs/helm/helm_status.md
Expand Up @@ -44,4 +44,4 @@ helm status [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
2 changes: 1 addition & 1 deletion docs/helm/helm_test.md
Expand Up @@ -41,4 +41,4 @@ helm test [RELEASE]
### 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
3 changes: 2 additions & 1 deletion docs/helm/helm_upgrade.md
Expand Up @@ -38,6 +38,7 @@ helm upgrade [RELEASE] [CHART]
```
--ca-file string verify certificates of HTTPS-enabled servers using this CA bundle
--cert-file string identify HTTPS client using this SSL certificate file
--devel use development versions, too. Equivalent to version '>0.0.0-a'. If --version is set, this is ignored.
--dry-run simulate an upgrade
-i, --install if a release by this name doesn't already exist, run an install
--key-file string identify HTTPS client using this SSL key file
Expand Down Expand Up @@ -74,4 +75,4 @@ helm upgrade [RELEASE] [CHART]
### 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
2 changes: 1 addition & 1 deletion docs/helm/helm_verify.md
Expand Up @@ -39,4 +39,4 @@ helm verify [flags] PATH
### 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
2 changes: 1 addition & 1 deletion docs/helm/helm_version.md
Expand Up @@ -53,4 +53,4 @@ helm version
### 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/man/man1/helm.1
@@ -1,4 +1,4 @@
.TH "HELM" "1" "Apr 2017" "Auto generated by spf13/cobra" ""
.TH "HELM" "1" "May 2017" "Auto generated by spf13/cobra" ""
.nh
.ad l

Expand Down Expand Up @@ -82,4 +82,4 @@ Environment:

.SH HISTORY
.PP
16\-Apr\-2017 Auto generated by spf13/cobra
17\-May\-2017 Auto generated by spf13/cobra
4 changes: 2 additions & 2 deletions docs/man/man1/helm_completion.1
@@ -1,4 +1,4 @@
.TH "HELM" "1" "Apr 2017" "Auto generated by spf13/cobra" ""
.TH "HELM" "1" "May 2017" "Auto generated by spf13/cobra" ""
.nh
.ad l

Expand Down Expand Up @@ -71,4 +71,4 @@ $ source <(helm completion bash)

.SH HISTORY
.PP
16\-Apr\-2017 Auto generated by spf13/cobra
17\-May\-2017 Auto generated by spf13/cobra

0 comments on commit e0379e1

Please sign in to comment.