本文整理汇总了Golang中github.com/openshift/origin/pkg/cmd/util/clientcmd.EnvVars函数的典型用法代码示例。如果您正苦于以下问题:Golang EnvVars函数的具体用法?Golang EnvVars怎么用?Golang EnvVars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EnvVars函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: RunDeploymentController
// RunDeploymentController starts the deployment controller process.
func (c *MasterConfig) RunDeploymentController() {
rcInformer := c.Informers.ReplicationControllers().Informer()
podInformer := c.Informers.Pods().Informer()
_, kclient := c.DeploymentControllerClients()
_, kclientConfig, err := configapi.GetKubeClient(c.Options.MasterClients.OpenShiftLoopbackKubeConfig, c.Options.MasterClients.OpenShiftLoopbackClientConnectionOverrides)
if err != nil {
glog.Fatalf("Unable to initialize deployment controller: %v", err)
}
// TODO eliminate these environment variables once service accounts provide a kubeconfig that includes all of this info
env := clientcmd.EnvVars(
kclientConfig.Host,
kclientConfig.CAData,
kclientConfig.Insecure,
path.Join(serviceaccountadmission.DefaultAPITokenMountPath, kapi.ServiceAccountTokenKey),
)
controller := deploycontroller.NewDeploymentController(
rcInformer,
podInformer,
kclient,
bootstrappolicy.DeployerServiceAccountName,
c.ImageFor("deployer"),
env,
c.ExternalVersionCodec,
)
go controller.Run(5, utilwait.NeverStop)
}
示例2: RunDeploymentController
// RunDeploymentController starts the deployment controller process.
func (c *MasterConfig) RunDeploymentController() {
_, kclient := c.DeploymentControllerClients()
_, kclientConfig, err := configapi.GetKubeClient(c.Options.MasterClients.OpenShiftLoopbackKubeConfig)
if err != nil {
glog.Fatalf("Unable to initialize deployment controller: %v", err)
}
// TODO eliminate these environment variables once service accounts provide a kubeconfig that includes all of this info
env := clientcmd.EnvVars(
kclientConfig.Host,
kclientConfig.CAData,
kclientConfig.Insecure,
path.Join(serviceaccountadmission.DefaultAPITokenMountPath, kapi.ServiceAccountTokenKey),
)
factory := deploycontroller.DeploymentControllerFactory{
KubeClient: kclient,
Codec: c.EtcdHelper.Codec(),
Environment: env,
DeployerImage: c.ImageFor("deployer"),
ServiceAccount: bootstrappolicy.DeployerServiceAccountName,
}
controller := factory.Create()
controller.Run()
}
示例3: RunDeploymentController
// RunDeploymentController starts the deployment controller process.
func (c *MasterConfig) RunDeploymentController() {
rcInformer := c.Informers.ReplicationControllers().Informer()
podInformer := c.Informers.Pods().Informer()
_, kclient := c.DeploymentControllerClients()
_, kclientConfig, err := configapi.GetKubeClient(c.Options.MasterClients.OpenShiftLoopbackKubeConfig)
if err != nil {
glog.Fatalf("Unable to initialize deployment controller: %v", err)
}
// TODO eliminate these environment variables once service accounts provide a kubeconfig that includes all of this info
env := clientcmd.EnvVars(
kclientConfig.Host,
kclientConfig.CAData,
kclientConfig.Insecure,
path.Join(serviceaccountadmission.DefaultAPITokenMountPath, kapi.ServiceAccountTokenKey),
)
controller := deploycontroller.NewDeploymentController(
rcInformer,
podInformer,
kclient,
bootstrappolicy.DeployerServiceAccountName,
c.ImageFor("deployer"),
env,
c.EtcdHelper.Codec(),
)
// TODO: Make the stop channel actually work.
stopCh := make(chan struct{})
// TODO: Make the number of workers configurable.
go controller.Run(5, stopCh)
}