mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
pkg/kubeapiserver: pass authorizer in top level while building from legacy options
Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>
This commit is contained in:
parent
11ce6d2915
commit
3de0d9afbb
@ -167,8 +167,8 @@ func (o *BuiltInAuthorizationOptions) buildAuthorizationConfiguration() (*authzc
|
|||||||
case authzmodes.ModeWebhook:
|
case authzmodes.ModeWebhook:
|
||||||
authorizers = append(authorizers, authzconfig.AuthorizerConfiguration{
|
authorizers = append(authorizers, authzconfig.AuthorizerConfiguration{
|
||||||
Type: authzconfig.TypeWebhook,
|
Type: authzconfig.TypeWebhook,
|
||||||
Webhook: &authzconfig.WebhookConfiguration{
|
|
||||||
Name: defaultWebhookName,
|
Name: defaultWebhookName,
|
||||||
|
Webhook: &authzconfig.WebhookConfiguration{
|
||||||
AuthorizedTTL: metav1.Duration{Duration: o.WebhookCacheAuthorizedTTL},
|
AuthorizedTTL: metav1.Duration{Duration: o.WebhookCacheAuthorizedTTL},
|
||||||
UnauthorizedTTL: metav1.Duration{Duration: o.WebhookCacheUnauthorizedTTL},
|
UnauthorizedTTL: metav1.Duration{Duration: o.WebhookCacheUnauthorizedTTL},
|
||||||
// Timeout and FailurePolicy are required for the new configuration.
|
// Timeout and FailurePolicy are required for the new configuration.
|
||||||
@ -183,9 +183,18 @@ func (o *BuiltInAuthorizationOptions) buildAuthorizationConfiguration() (*authzc
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
default:
|
default:
|
||||||
authorizers = append(authorizers, authzconfig.AuthorizerConfiguration{Type: authzconfig.AuthorizerType(mode)})
|
authorizers = append(authorizers, authzconfig.AuthorizerConfiguration{
|
||||||
|
Type: authzconfig.AuthorizerType(mode),
|
||||||
|
Name: getNameForAuthorizerMode(mode),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return &authzconfig.AuthorizationConfiguration{Authorizers: authorizers}, nil
|
return &authzconfig.AuthorizationConfiguration{Authorizers: authorizers}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// getNameForAuthorizerMode returns the name to be set for the mode in AuthorizationConfiguration
|
||||||
|
// For now, lower cases the mode name
|
||||||
|
func getNameForAuthorizerMode(mode string) string {
|
||||||
|
return strings.ToLower(mode)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user