Skip to content

Commit ab93dcd

Browse files
committed
Separate serviceaccount and secret storage config.
This commit adapts changes from kubernetes/kubernetes#47822 to OpenShift.
1 parent fd2dde1 commit ab93dcd

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

pkg/cmd/server/origin/master_config.go

+15-3
Original file line numberDiff line numberDiff line change
@@ -742,14 +742,26 @@ func newServiceAccountTokenGetter(options configapi.MasterConfig) (serviceaccoun
742742
return nil, err
743743
}
744744

745-
storageConfig, err := kubeStorageFactory.NewConfig(kapi.Resource("serviceaccounts"))
745+
storageConfigServiceAccounts, err := kubeStorageFactory.NewConfig(kapi.Resource("serviceaccounts"))
746746
if err != nil {
747747
return nil, err
748748
}
749+
storageConfigSecrets, err := kubeStorageFactory.NewConfig(kapi.Resource("secrets"))
750+
if err != nil {
751+
return nil, err
752+
}
753+
749754
// TODO: by doing this we will not be able to authenticate while a master quorum is not present - reimplement
750755
// as two storages called in succession (non quorum and then quorum).
751-
storageConfig.Quorum = true
752-
return sacontroller.NewGetterFromStorageInterface(storageConfig, kubeStorageFactory.ResourcePrefix(kapi.Resource("serviceaccounts")), kubeStorageFactory.ResourcePrefix(kapi.Resource("secrets"))), nil
756+
storageConfigServiceAccounts.Quorum = true
757+
storageConfigSecrets.Quorum = true
758+
759+
return sacontroller.NewGetterFromStorageInterface(
760+
storageConfigServiceAccounts,
761+
kubeStorageFactory.ResourcePrefix(kapi.Resource("serviceaccounts")),
762+
storageConfigSecrets,
763+
kubeStorageFactory.ResourcePrefix(kapi.Resource("secrets")),
764+
), nil
753765
}
754766

755767
func newAuthenticator(config configapi.MasterConfig, restOptionsGetter restoptions.Getter, tokenGetter serviceaccount.ServiceAccountTokenGetter, apiClientCAs *x509.CertPool, groupMapper identitymapper.UserToGroupMapper) (authenticator.Request, error) {

0 commit comments

Comments
 (0)