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
+9
View File
@@ -109,6 +109,15 @@ exec: helm repo add myRepo https://repo.example.com/ --kube-context dev:
expected = `Adding repo myRepo https://repo.example.com/
exec: helm repo add myRepo https://repo.example.com/ --username example_user --password example_password --kube-context dev
exec: helm repo add myRepo https://repo.example.com/ --username example_user --password example_password --kube-context dev:
`
if buffer.String() != expected {
t.Errorf("helmexec.AddRepo()\nactual = %v\nexpect = %v", buffer.String(), expected)
}
buffer.Reset()
helm.AddRepo("", "https://repo.example.com/", "", "", "", "", "")
expected = `empty field name
`
if buffer.String() != expected {
t.Errorf("helmexec.AddRepo()\nactual = %v\nexpect = %v", buffer.String(), expected)