fix typo for AnonymousAuthConfigurableEndpoints error

This commit is contained in:
Dmitri Fedotov
2025-10-02 15:57:04 +03:00
parent 8ac5701d3a
commit d71e7e7859
2 changed files with 2 additions and 2 deletions

View File

@@ -562,7 +562,7 @@ anonymous:
enabled: false
`),
},
expectErr: "anonymous is not supported when AnonymousAuthConfigurableEnpoints feature gate is disabled",
expectErr: "anonymous is not supported when AnonymousAuthConfigurableEndpoints feature gate is disabled",
},
{
name: "file-anonymous-disabled-AnonymousAuthConfigurableEndpoints-enabled",

View File

@@ -79,7 +79,7 @@ func ValidateAuthenticationConfiguration(compiler authenticationcel.Compiler, c
if c.Anonymous != nil {
if !utilfeature.DefaultFeatureGate.Enabled(features.AnonymousAuthConfigurableEndpoints) {
allErrs = append(allErrs, field.Forbidden(field.NewPath("anonymous"), "anonymous is not supported when AnonymousAuthConfigurableEnpoints feature gate is disabled"))
allErrs = append(allErrs, field.Forbidden(field.NewPath("anonymous"), "anonymous is not supported when AnonymousAuthConfigurableEndpoints 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"))