mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
Wire bootstrap token authn secret lister only when it is enabled
Signed-off-by: Monis Khan <mok@microsoft.com>
This commit is contained in:
parent
8b2dae57d4
commit
94f2d35164
@ -142,12 +142,11 @@ func (config Config) New() (authenticator.Request, *spec.SecurityDefinitions, er
|
|||||||
}
|
}
|
||||||
tokenAuthenticators = append(tokenAuthenticators, serviceAccountAuth)
|
tokenAuthenticators = append(tokenAuthenticators, serviceAccountAuth)
|
||||||
}
|
}
|
||||||
if config.BootstrapToken {
|
|
||||||
if config.BootstrapTokenAuthenticator != nil {
|
if config.BootstrapToken && config.BootstrapTokenAuthenticator != nil {
|
||||||
// TODO: This can sometimes be nil because of
|
tokenAuthenticators = append(tokenAuthenticators, authenticator.WrapAudienceAgnosticToken(config.APIAudiences, config.BootstrapTokenAuthenticator))
|
||||||
tokenAuthenticators = append(tokenAuthenticators, authenticator.WrapAudienceAgnosticToken(config.APIAudiences, config.BootstrapTokenAuthenticator))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE(ericchiang): Keep the OpenID Connect after Service Accounts.
|
// NOTE(ericchiang): Keep the OpenID Connect after Service Accounts.
|
||||||
//
|
//
|
||||||
// Because both plugins verify JWTs whichever comes first in the union experiences
|
// Because both plugins verify JWTs whichever comes first in the union experiences
|
||||||
|
@ -485,9 +485,11 @@ func (o *BuiltInAuthenticationOptions) ApplyTo(authInfo *genericapiserver.Authen
|
|||||||
)
|
)
|
||||||
authenticatorConfig.SecretsWriter = extclient.CoreV1()
|
authenticatorConfig.SecretsWriter = extclient.CoreV1()
|
||||||
|
|
||||||
authenticatorConfig.BootstrapTokenAuthenticator = bootstrap.NewTokenAuthenticator(
|
if authenticatorConfig.BootstrapToken {
|
||||||
versionedInformer.Core().V1().Secrets().Lister().Secrets(metav1.NamespaceSystem),
|
authenticatorConfig.BootstrapTokenAuthenticator = bootstrap.NewTokenAuthenticator(
|
||||||
)
|
versionedInformer.Core().V1().Secrets().Lister().Secrets(metav1.NamespaceSystem),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if egressSelector != nil {
|
if egressSelector != nil {
|
||||||
egressDialer, err := egressSelector.Lookup(egressselector.ControlPlane.AsNetworkContext())
|
egressDialer, err := egressSelector.Lookup(egressselector.ControlPlane.AsNetworkContext())
|
||||||
|
Loading…
Reference in New Issue
Block a user