Skip to content

Commit cf6d113

Browse files
committed
fix npe in serviceAccount flow
1 parent 61dbc03 commit cf6d113

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/kubeapiserver/authenticator/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func (config Config) New(serverLifecycle context.Context) (authenticator.Request
138138
}
139139
tokenAuthenticators = append(tokenAuthenticators, serviceAccountAuth)
140140
}
141-
if len(config.ServiceAccountIssuers) > 0 {
141+
if len(config.ServiceAccountIssuers) > 0 && config.ServiceAccountPublicKeysGetter != nil {
142142
serviceAccountAuth, err := newServiceAccountAuthenticator(config.ServiceAccountIssuers, config.ServiceAccountPublicKeysGetter, config.APIAudiences, config.ServiceAccountTokenGetter)
143143
if err != nil {
144144
return nil, nil, nil, nil, err

0 commit comments

Comments
 (0)