@@ -167,8 +167,8 @@ func (o *BuiltInAuthorizationOptions) buildAuthorizationConfiguration() (*authzc
167
167
case authzmodes .ModeWebhook :
168
168
authorizers = append (authorizers , authzconfig.AuthorizerConfiguration {
169
169
Type : authzconfig .TypeWebhook ,
170
+ Name : defaultWebhookName ,
170
171
Webhook : & authzconfig.WebhookConfiguration {
171
- Name : defaultWebhookName ,
172
172
AuthorizedTTL : metav1.Duration {Duration : o .WebhookCacheAuthorizedTTL },
173
173
UnauthorizedTTL : metav1.Duration {Duration : o .WebhookCacheUnauthorizedTTL },
174
174
// Timeout and FailurePolicy are required for the new configuration.
@@ -183,9 +183,18 @@ func (o *BuiltInAuthorizationOptions) buildAuthorizationConfiguration() (*authzc
183
183
},
184
184
})
185
185
default :
186
- authorizers = append (authorizers , authzconfig.AuthorizerConfiguration {Type : authzconfig .AuthorizerType (mode )})
186
+ authorizers = append (authorizers , authzconfig.AuthorizerConfiguration {
187
+ Type : authzconfig .AuthorizerType (mode ),
188
+ Name : getNameForAuthorizerMode (mode ),
189
+ })
187
190
}
188
191
}
189
192
190
193
return & authzconfig.AuthorizationConfiguration {Authorizers : authorizers }, nil
191
194
}
195
+
196
+ // getNameForAuthorizerMode returns the name to be set for the mode in AuthorizationConfiguration
197
+ // For now, lower cases the mode name
198
+ func getNameForAuthorizerMode (mode string ) string {
199
+ return strings .ToLower (mode )
200
+ }
0 commit comments