Skip to content

Commit

Permalink
Separate serviceaccount and secret storage config.
Browse files Browse the repository at this point in the history
This commit adapts changes from kubernetes/kubernetes#47822 to OpenShift.
  • Loading branch information
php-coder committed Jun 22, 2017
1 parent fd2dde1 commit ab93dcd
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions pkg/cmd/server/origin/master_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,14 +742,26 @@ func newServiceAccountTokenGetter(options configapi.MasterConfig) (serviceaccoun
return nil, err
}

storageConfig, err := kubeStorageFactory.NewConfig(kapi.Resource("serviceaccounts"))
storageConfigServiceAccounts, err := kubeStorageFactory.NewConfig(kapi.Resource("serviceaccounts"))
if err != nil {
return nil, err
}
storageConfigSecrets, err := kubeStorageFactory.NewConfig(kapi.Resource("secrets"))
if err != nil {
return nil, err
}

// TODO: by doing this we will not be able to authenticate while a master quorum is not present - reimplement
// as two storages called in succession (non quorum and then quorum).
storageConfig.Quorum = true
return sacontroller.NewGetterFromStorageInterface(storageConfig, kubeStorageFactory.ResourcePrefix(kapi.Resource("serviceaccounts")), kubeStorageFactory.ResourcePrefix(kapi.Resource("secrets"))), nil
storageConfigServiceAccounts.Quorum = true
storageConfigSecrets.Quorum = true

return sacontroller.NewGetterFromStorageInterface(
storageConfigServiceAccounts,
kubeStorageFactory.ResourcePrefix(kapi.Resource("serviceaccounts")),
storageConfigSecrets,
kubeStorageFactory.ResourcePrefix(kapi.Resource("secrets")),
), nil
}

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

0 comments on commit ab93dcd

Please sign in to comment.