From 918deeef181f20ea640bc562cef69d209493cbab Mon Sep 17 00:00:00 2001 From: Matthias Riegler Date: Fri, 1 May 2020 13:21:44 +0200 Subject: [PATCH] added option --insecure-skip-tls-verify for helm pull, addresses #7875 Signed-off-by: Matthias Riegler --- cmd/helm/flags.go | 1 + pkg/action/install.go | 19 ++++++++++--------- pkg/action/pull.go | 1 + 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cmd/helm/flags.go b/cmd/helm/flags.go index 246cb0dd5..d35a05fec 100644 --- a/cmd/helm/flags.go +++ b/cmd/helm/flags.go @@ -49,6 +49,7 @@ func addChartPathOptionsFlags(f *pflag.FlagSet, c *action.ChartPathOptions) { f.StringVar(&c.Password, "password", "", "chart repository password where to locate the requested chart") f.StringVar(&c.CertFile, "cert-file", "", "identify HTTPS client using this SSL certificate file") f.StringVar(&c.KeyFile, "key-file", "", "identify HTTPS client using this SSL key file") + f.BoolVar(&c.InsecureSkipTLSverify, "insecure-skip-tls-verify", false, "skip tls certificate checks for the chart download") f.StringVar(&c.CaFile, "ca-file", "", "verify certificates of HTTPS-enabled servers using this CA bundle") } diff --git a/pkg/action/install.go b/pkg/action/install.go index 10a9644dd..cb5318965 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -104,15 +104,16 @@ type Install struct { // ChartPathOptions captures common options used for controlling chart paths type ChartPathOptions struct { - CaFile string // --ca-file - CertFile string // --cert-file - KeyFile string // --key-file - Keyring string // --keyring - Password string // --password - RepoURL string // --repo - Username string // --username - Verify bool // --verify - Version string // --version + CaFile string // --ca-file + CertFile string // --cert-file + KeyFile string // --key-file + InsecureSkipTLSverify bool // --insecure-skip-verify + Keyring string // --keyring + Password string // --password + RepoURL string // --repo + Username string // --username + Verify bool // --verify + Version string // --version } // NewInstall creates a new Install object with the given configuration. diff --git a/pkg/action/pull.go b/pkg/action/pull.go index ee20bbe83..a46e98bae 100644 --- a/pkg/action/pull.go +++ b/pkg/action/pull.go @@ -64,6 +64,7 @@ func (p *Pull) Run(chartRef string) (string, error) { Options: []getter.Option{ getter.WithBasicAuth(p.Username, p.Password), getter.WithTLSClientConfig(p.CertFile, p.KeyFile, p.CaFile), + getter.WithInsecureSkipVerifyTLS(p.InsecureSkipTLSverify), }, RepositoryConfig: p.Settings.RepositoryConfig, RepositoryCache: p.Settings.RepositoryCache,