本文整理汇总了Golang中k8s/io/kubernetes/pkg/api.EnvVar.Name方法的典型用法代码示例。如果您正苦于以下问题:Golang EnvVar.Name方法的具体用法?Golang EnvVar.Name怎么用?Golang EnvVar.Name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类k8s/io/kubernetes/pkg/api.EnvVar
的用法示例。
在下文中一共展示了EnvVar.Name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: deepCopy_api_EnvVar
func deepCopy_api_EnvVar(in api.EnvVar, out *api.EnvVar, c *conversion.Cloner) error {
out.Name = in.Name
out.Value = in.Value
if in.ValueFrom != nil {
out.ValueFrom = new(api.EnvVarSource)
if err := deepCopy_api_EnvVarSource(*in.ValueFrom, out.ValueFrom, c); err != nil {
return err
}
} else {
out.ValueFrom = nil
}
return nil
}
示例2: writeEnvVar
func writeEnvVar(m map[string]interface{}, item *api.EnvVar) {
if x, ok := m["name"].(string); ok {
item.Name = x
}
if x, ok := m["value"].(string); ok {
item.Value = x
}
if n, ok := extractSingleMap(m["value_from"]); ok {
item.Value = ""
item.ValueFrom = &api.EnvVarSource{}
if o, ok := extractSingleMap(n["field_ref"]); ok {
item.ValueFrom.FieldRef = &api.ObjectFieldSelector{}
if x, ok := o["field_path"].(string); ok {
item.ValueFrom.FieldRef.FieldPath = x
}
}
if o, ok := extractSingleMap(n["config_map_key_ref"]); ok {
item.ValueFrom.ConfigMapKeyRef = &api.ConfigMapKeySelector{}
if x, ok := o["name"].(string); ok {
item.ValueFrom.ConfigMapKeyRef.Name = x
}
if x, ok := o["key"].(string); ok {
item.ValueFrom.ConfigMapKeyRef.Key = x
}
}
if o, ok := extractSingleMap(n["secret_key_ref"]); ok {
item.ValueFrom.SecretKeyRef = &api.SecretKeySelector{}
if x, ok := o["name"].(string); ok {
item.ValueFrom.SecretKeyRef.Name = x
}
if x, ok := o["key"].(string); ok {
item.ValueFrom.SecretKeyRef.Key = x
}
}
}
}
示例3:
var cl *client.Client
BeforeEach(func() {
// Setup the apiserver client
cl = client.NewOrDie(&restclient.Config{Host: *apiServerAddress})
})
Describe("container conformance blackbox test", func() {
Context("when running a container that terminates", func() {
var terminateCase ConformanceContainer
var terminateImage ConformanceImage
BeforeEach(func() {
var envs []api.EnvVar
var env api.EnvVar
env.Name = "USERNAME"
env.Value = "tiesheng"
envs = append(envs, env)
env.Name = "PASSWORD"
env.Value = "opensource"
envs = append(envs, env)
env.Name = "EMAIL"
env.Value = "[email protected]"
envs = append(envs, env)
env.Name = "GIT_REPO"
env.Value = "https://github.com/docker-library/hello-world.git"
envs = append(envs, env)