mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-19 17:49:41 +02:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user