diff --git a/cmd/helm/install.go b/cmd/helm/install.go index 03abfa3e1..74a104514 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -386,7 +386,7 @@ func (i *installCmd) printRelease(rel *release.Release) { // // If 'verify' is true, this will attempt to also verify the chart. func locateChartPath(repoURL, username, password, name, version string, verify bool, keyring, -certFile, keyFile, caFile string) (string, error) { + certFile, keyFile, caFile string) (string, error) { name = strings.TrimSpace(name) version = strings.TrimSpace(version) if fi, err := os.Stat(name); err == nil { diff --git a/cmd/helm/repo_add.go b/cmd/helm/repo_add.go index fcaf32000..bbf0de9f8 100644 --- a/cmd/helm/repo_add.go +++ b/cmd/helm/repo_add.go @@ -49,7 +49,7 @@ func newRepoAddCmd(out io.Writer) *cobra.Command { Use: "add [flags] [NAME] [URL] [USERNAME] [PASSWORD]", Short: "add a chart repository", RunE: func(cmd *cobra.Command, args []string) error { - argsDesc := []string { + argsDesc := []string{ "name for the chart repository", "the url of the chart repository", "the username for the chart repository", @@ -60,8 +60,7 @@ func newRepoAddCmd(out io.Writer) *cobra.Command { if err := checkArgsLength(len(args), argsDesc[0], argsDesc[1]); err != nil { return err } - } else - if err := checkArgsLength(len(args), argsDesc[0], argsDesc[1], argsDesc[2], argsDesc[3]); err != nil { + } else if err := checkArgsLength(len(args), argsDesc[0], argsDesc[1], argsDesc[2], argsDesc[3]); err != nil { return err } @@ -87,7 +86,7 @@ func newRepoAddCmd(out io.Writer) *cobra.Command { } func (a *repoAddCmd) run() error { - if err := addRepository(a.name, a.url, a.username, a.password , a.home, a.certFile, a.keyFile, a.caFile, a.noupdate); err != nil { + if err := addRepository(a.name, a.url, a.username, a.password, a.home, a.certFile, a.keyFile, a.caFile, a.noupdate); err != nil { return err } fmt.Fprintf(a.out, "%q has been added to your repositories\n", a.name) diff --git a/docs/helm/helm_inspect.md b/docs/helm/helm_inspect.md index 9928ed847..e46b3dbf4 100644 --- a/docs/helm/helm_inspect.md +++ b/docs/helm/helm_inspect.md @@ -23,7 +23,9 @@ helm inspect [CHART] --cert-file string verify certificates of HTTPS-enabled servers using this CA bundle --key-file string identify HTTPS client using this SSL key file --keyring string path to the keyring containing public verification keys (default "~/.gnupg/pubring.gpg") + --password string chart repository password where to locate the requested chart --repo string chart repository url where to locate the requested chart + --username string chart repository username where to locate the requested chart --verify verify the provenance data for this chart --version string version of the chart. By default, the newest chart is shown ``` diff --git a/docs/helm/helm_inspect_chart.md b/docs/helm/helm_inspect_chart.md index bfa6061c8..cd1328b59 100644 --- a/docs/helm/helm_inspect_chart.md +++ b/docs/helm/helm_inspect_chart.md @@ -21,7 +21,9 @@ helm inspect chart [CHART] --cert-file string verify certificates of HTTPS-enabled servers using this CA bundle --key-file string identify HTTPS client using this SSL key file --keyring string path to the keyring containing public verification keys (default "~/.gnupg/pubring.gpg") + --password string chart repository password where to locate the requested chart --repo string chart repository url where to locate the requested chart + --username string chart repository username where to locate the requested chart --verify verify the provenance data for this chart --version string version of the chart. By default, the newest chart is shown ``` diff --git a/docs/helm/helm_inspect_values.md b/docs/helm/helm_inspect_values.md index fbf8660c2..6a907cc7d 100644 --- a/docs/helm/helm_inspect_values.md +++ b/docs/helm/helm_inspect_values.md @@ -21,7 +21,9 @@ helm inspect values [CHART] --cert-file string verify certificates of HTTPS-enabled servers using this CA bundle --key-file string identify HTTPS client using this SSL key file --keyring string path to the keyring containing public verification keys (default "~/.gnupg/pubring.gpg") + --password string chart repository password where to locate the requested chart --repo string chart repository url where to locate the requested chart + --username string chart repository username where to locate the requested chart --verify verify the provenance data for this chart --version string version of the chart. By default, the newest chart is shown ``` diff --git a/docs/helm/helm_install.md b/docs/helm/helm_install.md index 406416dc8..0ae9097ba 100644 --- a/docs/helm/helm_install.md +++ b/docs/helm/helm_install.md @@ -80,6 +80,7 @@ helm install [CHART] --name-template string specify template used to name the release --namespace string namespace to install the release into. Defaults to the current kube config namespace. --no-hooks prevent hooks from running during install + --password string chart repository password where to locate the requested chart --replace re-use the given name, even if that name is already used. This is unsafe in production --repo string chart repository url where to locate the requested chart --set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) @@ -89,6 +90,7 @@ helm install [CHART] --tls-cert string path to TLS certificate file (default "$HELM_HOME/cert.pem") --tls-key string path to TLS key file (default "$HELM_HOME/key.pem") --tls-verify enable TLS for request and verify remote + --username string chart repository username where to locate the requested chart -f, --values valueFiles specify values in a YAML file or a URL(can specify multiple) (default []) --verify verify the package before installing it --version string specify the exact chart version to install. If this is not specified, the latest version is installed diff --git a/docs/helm/helm_repo_add.md b/docs/helm/helm_repo_add.md index f0dfcbd5d..456ffa27e 100644 --- a/docs/helm/helm_repo_add.md +++ b/docs/helm/helm_repo_add.md @@ -18,6 +18,8 @@ helm repo add [flags] [NAME] [URL] --cert-file string identify HTTPS client using this SSL certificate file --key-file string identify HTTPS client using this SSL key file --no-update raise error if repo is already registered + --password string chart repository password + --username string chart repository username ``` ### Options inherited from parent commands diff --git a/docs/helm/helm_upgrade.md b/docs/helm/helm_upgrade.md index 5ed128958..5cbb9a110 100644 --- a/docs/helm/helm_upgrade.md +++ b/docs/helm/helm_upgrade.md @@ -46,6 +46,7 @@ helm upgrade [RELEASE] [CHART] --keyring string path to the keyring that contains public signing keys (default "~/.gnupg/pubring.gpg") --namespace string namespace to install the release into (only used if --install is set). Defaults to the current kube config namespace --no-hooks disable pre/post upgrade hooks + --password string chart repository password where to locate the requested chart --recreate-pods performs pods restart for the resource if applicable --repo string chart repository url where to locate the requested chart --reset-values when upgrading, reset the values to the ones built into the chart @@ -57,6 +58,7 @@ helm upgrade [RELEASE] [CHART] --tls-cert string path to TLS certificate file (default "$HELM_HOME/cert.pem") --tls-key string path to TLS key file (default "$HELM_HOME/key.pem") --tls-verify enable TLS for request and verify remote + --username string chart repository username where to locate the requested chart -f, --values valueFiles specify values in a YAML file or a URL(can specify multiple) (default []) --verify verify the provenance of the chart before upgrading --version string specify the exact chart version to use. If this is not specified, the latest version is used diff --git a/pkg/downloader/chart_downloader_test.go b/pkg/downloader/chart_downloader_test.go index 682ceaa2e..b043ef761 100644 --- a/pkg/downloader/chart_downloader_test.go +++ b/pkg/downloader/chart_downloader_test.go @@ -258,7 +258,7 @@ func TestDownloadTo_VerifyLater(t *testing.T) { Getters: getter.All(environment.EnvSettings{}), } cname := "/signtest-0.1.0.tgz" - where, _, err := c.DownloadTo(srv.URL()+cname,"", "", "", dest) + where, _, err := c.DownloadTo(srv.URL()+cname, "", "", "", dest) if err != nil { t.Error(err) return diff --git a/pkg/plugin/installer/http_installer_test.go b/pkg/plugin/installer/http_installer_test.go index ca409fdad..648b9b0c0 100644 --- a/pkg/plugin/installer/http_installer_test.go +++ b/pkg/plugin/installer/http_installer_test.go @@ -35,7 +35,9 @@ type TestHTTPGetter struct { func (t *TestHTTPGetter) Get(href string) (*bytes.Buffer, error) { return t.MockResponse, t.MockError } -func (t *TestHTTPGetter) GetWithCredentials(href, username, password string) (*bytes.Buffer, error) { return t.MockResponse, t.MockError } +func (t *TestHTTPGetter) GetWithCredentials(href, username, password string) (*bytes.Buffer, error) { + return t.MockResponse, t.MockError +} // Fake plugin tarball data var fakePluginB64 = "H4sIAKRj51kAA+3UX0vCUBgGcC9jn+Iwuk3Peza3GeyiUlJQkcogCOzgli7dJm4TvYk+a5+k479UqquUCJ/fLs549sLO2TnvWnJa9aXnjwujYdYLovxMhsPcfnHOLdNkOXthM/IVQQYjg2yyLLJ4kXGhLp5j0z3P41tZksqxmspL3B/O+j/XtZu1y8rdYzkOZRCxduKPk53ny6Wwz/GfIIf1As8lxzGJSmoHNLJZphKHG4YpTCE0wVk3DULfpSJ3DMMqkj3P5JfMYLdX1Vr9Ie/5E5cstcdC8K04iGLX5HaJuKpWL17F0TCIBi5pf/0pjtLhun5j3f9v6r7wfnI/H0eNp9d1/5P6Gez0vzo7wsoxfrAZbTny/o9k6J8z/VkO/LPlWdC1iVpbEEcq5nmeJ13LEtmbV0k2r2PrOs9PuuNglC5rL1Y5S/syXRQmutaNw1BGnnp8Wq3UG51WvX1da3bKtZtCN/R09DwAAAAAAAAAAAAAAAAAAADAb30AoMczDwAoAAA="