Skip to content

Commit

Permalink
Changing TestValidateAuthInfoExecInvalidEnv to allow for empty string…
Browse files Browse the repository at this point in the history
…s as Exec values
  • Loading branch information
pswica authored and Peter Swica committed Jul 25, 2019
1 parent 50c2ccf commit c055094
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -443,22 +443,19 @@ func TestValidateAuthInfoExecWithAuthProvider(t *testing.T) {
test.testConfig(t)
}

func TestValidateAuthInfoExecInvalidEnv(t *testing.T) {
func TestValidateAuthInfoExecNoEnv(t *testing.T) {
config := clientcmdapi.NewConfig()
config.AuthInfos["user"] = &clientcmdapi.AuthInfo{
Exec: &clientcmdapi.ExecConfig{
Command: "/bin/example",
APIVersion: "clientauthentication.k8s.io/v1alpha1",
Env: []clientcmdapi.ExecEnvVar{
{Name: "foo"}, // No value
{Name: "foo", Value: ""},
},
},
}
test := configValidationTest{
config: config,
expectedErrorSubstring: []string{
"env variable foo value must be specified for user to use exec authentication plugin",
},
}

test.testAuthInfo("user", t)
Expand Down

0 comments on commit c055094

Please sign in to comment.