Add validation for empty repository names (#1128)

Resolves #1112
This commit is contained in:
Gleidson Nascimento
2020-02-28 19:42:15 +09:00
committed by GitHub
parent af44965949
commit 00c4422a64
2 changed files with 13 additions and 0 deletions
+4
View File
@@ -84,6 +84,10 @@ func (helm *execer) SetHelmBinary(bin string) {
func (helm *execer) AddRepo(name, repository, cafile, certfile, keyfile, username, password string) error {
var args []string
if name == "" && repository != "" {
helm.logger.Infof("empty field name\n")
return fmt.Errorf("empty field name")
}
args = append(args, "repo", "add", name, repository)
if certfile != "" && keyfile != "" {
args = append(args, "--cert-file", certfile, "--key-file", keyfile)