diff --git a/pkg/kubeapiserver/options/authentication_test.go b/pkg/kubeapiserver/options/authentication_test.go index be372006b5e..3070ba705ec 100644 --- a/pkg/kubeapiserver/options/authentication_test.go +++ b/pkg/kubeapiserver/options/authentication_test.go @@ -563,7 +563,7 @@ anonymous: enabled: false `), }, - expectErr: "anonymous is not supported when when AnonymousAuthConfigurableEnpoints feature gate is disabled", + expectErr: "anonymous is not supported when AnonymousAuthConfigurableEnpoints feature gate is disabled", }, { name: "file-anonymous-disabled-AnonymousAuthConfigurableEndpoints-enabled", diff --git a/staging/src/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go b/staging/src/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go index fb148f2c975..e38e364539b 100644 --- a/staging/src/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go +++ b/staging/src/k8s.io/apiserver/pkg/apis/apiserver/validation/validation.go @@ -80,7 +80,7 @@ func ValidateAuthenticationConfiguration(c *api.AuthenticationConfiguration, dis if c.Anonymous != nil { if !utilfeature.DefaultFeatureGate.Enabled(features.AnonymousAuthConfigurableEndpoints) { - allErrs = append(allErrs, field.Forbidden(field.NewPath("anonymous"), "anonymous is not supported when when AnonymousAuthConfigurableEnpoints feature gate is disabled")) + allErrs = append(allErrs, field.Forbidden(field.NewPath("anonymous"), "anonymous is not supported when AnonymousAuthConfigurableEnpoints feature gate is disabled")) } if !c.Anonymous.Enabled && len(c.Anonymous.Conditions) > 0 { allErrs = append(allErrs, field.Invalid(field.NewPath("anonymous", "conditions"), c.Anonymous.Conditions, "enabled should be set to true when conditions are defined"))