Bugfix: do not print registry password to stdout when running (#1275)

* Bugfix: do not print registry password to stdout when running
Resolves #1274

Signed-off-by: Pascal Rivard <privard@rbbn.com>

* Update exec.go

Signed-off-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* fix lint issues

Signed-off-by: yxxhero <aiopsclub@163.com>

* Add unit test

Signed-off-by: Pascal Rivard <privard@rbbn.com>

---------

Signed-off-by: Pascal Rivard <privard@rbbn.com>
Signed-off-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: Pascal Rivard <privard@rbbn.com>
Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
Co-authored-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
ennekein
2024-01-10 07:26:47 +08:00
committed by GitHub
co-authored by Pascal Rivard yxxhero yxxhero
parent 2dee2cffef
commit dabbe5e7d4
2 changed files with 39 additions and 2 deletions
+2 -2
View File
@@ -210,7 +210,6 @@ func (helm *execer) RegistryLogin(repository, username, password, caFile, certFi
return nil
}
buffer := bytes.Buffer{}
args := []string{
"registry",
"login",
@@ -232,7 +231,8 @@ func (helm *execer) RegistryLogin(repository, username, password, caFile, certFi
args = append(args, "--insecure")
}
args = append(args, "--username", username, "--password-stdin", password)
args = append(args, "--username", username, "--password-stdin")
buffer := bytes.Buffer{}
buffer.Write([]byte(fmt.Sprintf("%s\n", password)))
helm.logger.Info("Logging in to registry")