From 5dc446b52d9b45b7ec041e58c5701f7c643c1fe2 Mon Sep 17 00:00:00 2001 From: Tom Runyon Date: Thu, 5 Jan 2023 10:32:36 -0500 Subject: [PATCH] cmd updates based on pr feedback Signed-off-by: Tom Runyon --- cmd/helm/flags.go | 1 + cmd/helm/pull.go | 3 +-- cmd/helm/root.go | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/helm/flags.go b/cmd/helm/flags.go index 76d6e0476..b775416d8 100644 --- a/cmd/helm/flags.go +++ b/cmd/helm/flags.go @@ -62,6 +62,7 @@ func addChartPathOptionsFlags(f *pflag.FlagSet, c *action.ChartPathOptions) { 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") f.BoolVar(&c.PassCredentialsAll, "pass-credentials", false, "pass credentials to all domains") + f.BoolVar(&c.PlainHTTP, "plain-http", false, "install charts from http registry") } // bindOutputFlag will add the output flag to the given command and bind the diff --git a/cmd/helm/pull.go b/cmd/helm/pull.go index 9d1c86be7..562a79712 100644 --- a/cmd/helm/pull.go +++ b/cmd/helm/pull.go @@ -43,7 +43,7 @@ result in an error, and the chart will not be saved locally. ` func newPullCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { - client := action.NewPullWithOpts(action.WithConfig(cfg), action.WithPullOptWriter(out)) + client := action.NewPullWithOpts(action.WithConfig(cfg)) cmd := &cobra.Command{ Use: "pull [chart URL | repo/chartname] [...]", @@ -87,7 +87,6 @@ func newPullCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { f.BoolVar(&client.VerifyLater, "prov", false, "fetch the provenance file, but don't perform verification") f.StringVar(&client.UntarDir, "untardir", ".", "if untar is specified, this flag specifies the name of the directory into which the chart is expanded") f.StringVarP(&client.DestDir, "destination", "d", ".", "location to write the chart. If this and untardir are specified, untardir is appended to this") - f.BoolVar(&client.PlainHTTP, "plain-http", false, "install charts from http registry") addChartPathOptionsFlags(f, &client.ChartPathOptions) err := cmd.RegisterFlagCompletionFunc("version", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { diff --git a/cmd/helm/root.go b/cmd/helm/root.go index 31275a27d..07ba434f0 100644 --- a/cmd/helm/root.go +++ b/cmd/helm/root.go @@ -257,6 +257,7 @@ func checkForExpiredRepos(repofile string) { } +// newRegistryClient creates a new registry client. plainHTTP takes precidence over any tls settings func newRegistryClient(certFile, keyFile, caFile string, insecureSkipTLSverify bool, plainHTTP bool) (*registry.Client, error) { if plainHTTP {