From 1e6ab3fb42973cb155f4ede57de7e503d9a337a4 Mon Sep 17 00:00:00 2001 From: aackerman Date: Fri, 12 Mar 2021 15:40:28 -0600 Subject: [PATCH] Allow passing the chart repo to helm template --- cmd/helm3.go | 3 +++ cmd/upgrade.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/cmd/helm3.go b/cmd/helm3.go index d65afb61..5188e840 100644 --- a/cmd/helm3.go +++ b/cmd/helm3.go @@ -92,6 +92,9 @@ func (d *diffCmd) template(isUpgrade bool) ([]byte, error) { if d.chartVersion != "" { flags = append(flags, "--version", d.chartVersion) } + if d.chartRepo != "" { + flags = append(flags, "--repo", d.chartRepo) + } if d.namespace != "" { flags = append(flags, "--namespace", d.namespace) } diff --git a/cmd/upgrade.go b/cmd/upgrade.go index 033c70a9..f69aaa9f 100644 --- a/cmd/upgrade.go +++ b/cmd/upgrade.go @@ -17,6 +17,7 @@ type diffCmd struct { release string chart string chartVersion string + chartRepo string client helm.Interface detailedExitCode bool devel bool @@ -96,6 +97,7 @@ func newChartCommand() *cobra.Command { var kubeconfig string f.StringVar(&kubeconfig, "kubeconfig", "", "This flag is ignored, to allow passing of this top level flag to helm") f.StringVar(&diff.chartVersion, "version", "", "specify the exact chart version to use. If this is not specified, the latest version is used") + f.StringVar(&diff.chartRepo, "repo", "", "specify the chart repository url to locate the requested chart") f.BoolVar(&diff.detailedExitCode, "detailed-exitcode", false, "return a non-zero exit code when there are changes") f.BoolP("suppress-secrets", "q", false, "suppress secrets in the output") f.BoolVar(&diff.showSecrets, "show-secrets", false, "do not redact secret values in the output")