mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
adds dynamic audit configuration
This commit is contained in:
@@ -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