adds dynamic audit configuration
This commit is contained in:
@@ -270,6 +270,7 @@ var apiVersionPriorities = map[schema.GroupVersion]priority{
|
||||
{Group: "scheduling.k8s.io", Version: "v1beta1"}: {group: 16600, version: 12},
|
||||
{Group: "scheduling.k8s.io", Version: "v1alpha1"}: {group: 16600, version: 9},
|
||||
{Group: "coordination.k8s.io", Version: "v1beta1"}: {group: 16500, version: 9},
|
||||
{Group: "auditregistration.k8s.io", Version: "v1alpha1"}: {group: 16400, version: 1},
|
||||
// Append a new group to the end of the list if unsure.
|
||||
// You can use min(existing group)-100 as the initial value for a group.
|
||||
// Version can be set to 9 (to have space around) for a new group.
|
||||
|
@@ -391,9 +391,6 @@ func buildGenericConfig(
|
||||
if lastErr = s.Authentication.ApplyTo(genericConfig); lastErr != nil {
|
||||
return
|
||||
}
|
||||
if lastErr = s.Audit.ApplyTo(genericConfig); lastErr != nil {
|
||||
return
|
||||
}
|
||||
if lastErr = s.Features.ApplyTo(genericConfig); lastErr != nil {
|
||||
return
|
||||
}
|
||||
@@ -464,6 +461,22 @@ func buildGenericConfig(
|
||||
}
|
||||
serviceResolver = buildServiceResolver(s.EnableAggregatorRouting, genericConfig.LoopbackClientConfig.Host, versionedInformers)
|
||||
|
||||
authInfoResolverWrapper := webhook.NewDefaultAuthenticationInfoResolverWrapper(proxyTransport, genericConfig.LoopbackClientConfig)
|
||||
|
||||
lastErr = s.Audit.ApplyTo(
|
||||
genericConfig,
|
||||
genericConfig.LoopbackClientConfig,
|
||||
versionedInformers,
|
||||
serveroptions.NewProcessInfo("kube-apiserver", "kube-system"),
|
||||
&serveroptions.WebhookOptions{
|
||||
AuthInfoResolverWrapper: authInfoResolverWrapper,
|
||||
ServiceResolver: serviceResolver,
|
||||
},
|
||||
)
|
||||
if lastErr != nil {
|
||||
return
|
||||
}
|
||||
|
||||
pluginInitializers, admissionPostStartHook, err = admissionConfig.New(proxyTransport, serviceResolver)
|
||||
if err != nil {
|
||||
lastErr = fmt.Errorf("failed to create admission plugin initializer: %v", err)
|
||||
|
Reference in New Issue
Block a user