mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-02 15:45:09 +00:00
* Kubectl user exec should accept zero-length environment values #652 * Changing TestValidateAuthInfoExecInvalidEnv to allow for empty strings as Exec values Kubernetes-commit: f30af9dd6da46f0f01e38b477d455907da9f1b6c
This commit is contained in:
committed by
Kubernetes Publisher
parent
a9c895e7f2
commit
579ad46bdc
@@ -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)
|
||||
|
Reference in New Issue
Block a user