feat: pass-credentials to repo (#1899)

This adds the ability to include the --pass-credentials flag to the helm add repo command by:

- Adding repo.passCredentials to the helmfile yaml
- Changing state, helmexec, and app to include RepositorySpec.PassCredentials

Resolves #1898

Co-authored-by: almed4 <alexandre.meddin@ingka.ikea.com>
This commit is contained in:
Alex Meddin
2021-07-02 07:31:16 +09:00
committed by GitHub
co-authored by almed4
parent c623730374
commit 46b17e2cdb
9 changed files with 89 additions and 54 deletions
+4 -1
View File
@@ -108,7 +108,7 @@ func (helm *execer) SetHelmBinary(bin string) {
helm.helmBinary = bin
}
func (helm *execer) AddRepo(name, repository, cafile, certfile, keyfile, username, password string, managed string) error {
func (helm *execer) AddRepo(name, repository, cafile, certfile, keyfile, username, password string, managed string, passCredentials string) error {
var args []string
var out []byte
var err error
@@ -141,6 +141,9 @@ func (helm *execer) AddRepo(name, repository, cafile, certfile, keyfile, usernam
if username != "" && password != "" {
args = append(args, "--username", username, "--password", password)
}
if passCredentials == "true" {
args = append(args, "--pass-credentials")
}
helm.logger.Infof("Adding repo %v %v", name, repository)
out, err = helm.exec(args, map[string]string{})
default: