diff --git a/cmd/helm/install.go b/cmd/helm/install.go index d3b830029..9858a85fe 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -119,6 +119,7 @@ type installCmd struct { wait bool repoURL string devel bool + depUp bool certFile string keyFile string @@ -194,6 +195,7 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command { 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-0'. If --version is set, this is ignored.") + f.BoolVar(&inst.depUp, "dep-up", false, "run helm dependency update before installing the chart") return cmd } @@ -231,7 +233,22 @@ func (i *installCmd) run() error { // As of Helm 2.4.0, this is treated as a stopping condition: // https://github.com/kubernetes/helm/issues/2209 if err := checkDependencies(chartRequested, req); err != nil { - return prettyError(err) + if i.depUp { + man := &downloader.Manager{ + Out: i.out, + ChartPath: i.chartPath, + HelmHome: settings.Home, + Keyring: defaultKeyring(), + SkipUpdate: false, + Getters: getter.All(settings), + } + if err := man.Update(); err != nil { + return prettyError(err) + } + } else { + return prettyError(err) + } + } } else if err != chartutil.ErrRequirementsNotFound { return fmt.Errorf("cannot load requirements: %v", err) diff --git a/docs/helm/helm_install.md b/docs/helm/helm_install.md index 74fe19759..7596688e1 100644 --- a/docs/helm/helm_install.md +++ b/docs/helm/helm_install.md @@ -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 + --dep-up run helm dependency update before installing the chart --devel use development versions, too. Equivalent to version '>0.0.0-0'. If --version is set, this is ignored. --dry-run simulate an install --key-file string identify HTTPS client using this SSL key file diff --git a/docs/man/man1/helm_install.1 b/docs/man/man1/helm_install.1 index a19b3adf4..fe1856bed 100644 --- a/docs/man/man1/helm_install.1 +++ b/docs/man/man1/helm_install.1 @@ -122,6 +122,10 @@ charts in a repository, use 'helm search'. \fB\-\-cert\-file\fP="" identify HTTPS client using this SSL certificate file +.PP +\fB\-\-dep\-up\fP[=false] + run helm dependency update before installing the chart. + .PP \fB\-\-devel\fP[=false] use development versions, too. Equivalent to version '>0.0.0\-a'. If \-\-version is set, this is ignored. @@ -236,4 +240,4 @@ charts in a repository, use 'helm search'. .SH HISTORY .PP -19\-May\-2017 Auto generated by spf13/cobra +31\-Oct\-2017 Auto generated by spf13/cobra