Add basic repository authentication (#154)

* basic repository authentication via new `username` and `password` keys

* add warning to readme
This commit is contained in:
Dan O'Brien
2018-05-31 10:42:38 +09:00
committed by KUOKA Yusuke
parent 1768e5dea7
commit 1a4f342f25
6 changed files with 46 additions and 11 deletions
+4 -1
View File
@@ -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