本文整理汇总了Golang中github.com/openshift/origin/pkg/serviceaccounts.Clients函数的典型用法代码示例。如果您正苦于以下问题:Golang Clients函数的具体用法?Golang Clients怎么用?Golang Clients使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Clients函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: GetServiceAccountClients
// GetServiceAccountClients returns an OpenShift and Kubernetes client with the credentials of the
// named service account in the infra namespace
func (c *MasterConfig) GetServiceAccountClients(name string) (*osclient.Client, *kclient.Client, error) {
if len(name) == 0 {
return nil, nil, errors.New("No service account name specified")
}
return serviceaccounts.Clients(
c.PrivilegedLoopbackClientConfig,
&serviceaccounts.ClientLookupTokenRetriever{Client: c.PrivilegedLoopbackKubernetesClient},
c.Options.PolicyConfig.OpenShiftInfrastructureNamespace,
name,
)
}
示例2: GetServiceAccountClientsWithConfig
func (c *MasterConfig) GetServiceAccountClientsWithConfig(name string, config restclient.Config) (*restclient.Config, *osclient.Client, *kclientset.Clientset, error) {
if len(name) == 0 {
return nil, nil, nil, errors.New("No service account name specified")
}
configToReturn, oc, kcset, err := serviceaccounts.Clients(
config,
&serviceaccounts.ClientLookupTokenRetriever{Client: c.PrivilegedLoopbackKubernetesClientset},
c.Options.PolicyConfig.OpenShiftInfrastructureNamespace,
name,
)
return configToReturn, oc, kcset, err
}