mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-19 02:47:27 +02:00
Add basic repository authentication (#154)
* basic repository authentication via new `username` and `password` keys * add warning to readme
This commit is contained in:
committed by
KUOKA Yusuke
parent
1768e5dea7
commit
1a4f342f25
+4
-1
@@ -30,12 +30,15 @@ func (helm *execer) SetExtraArgs(args ...string) {
|
||||
helm.extra = args
|
||||
}
|
||||
|
||||
func (helm *execer) AddRepo(name, repository, certfile, keyfile string) error {
|
||||
func (helm *execer) AddRepo(name, repository, certfile, keyfile, username, password string) error {
|
||||
var args []string
|
||||
args = append(args, "repo", "add", name, repository)
|
||||
if certfile != "" && keyfile != "" {
|
||||
args = append(args, "--cert-file", certfile, "--key-file", keyfile)
|
||||
}
|
||||
if username != "" && password != "" {
|
||||
args = append(args, "--username", username, "--password", password)
|
||||
}
|
||||
out, err := helm.exec(args...)
|
||||
helm.write(out)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user