本文整理汇总了Golang中github.com/openshift/origin/pkg/template/api.Parameter.Name方法的典型用法代码示例。如果您正苦于以下问题:Golang Parameter.Name方法的具体用法?Golang Parameter.Name怎么用?Golang Parameter.Name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/openshift/origin/pkg/template/api.Parameter
的用法示例。
在下文中一共展示了Parameter.Name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: DefaultTemplate
func DefaultTemplate() *templateapi.Template {
ret := &templateapi.Template{}
ret.Name = DefaultTemplateName
ns := "${" + ProjectNameParam + "}"
project := &projectapi.Project{}
project.Name = ns
project.Annotations = map[string]string{
projectapi.ProjectDescription: "${" + ProjectDescriptionParam + "}",
projectapi.ProjectDisplayName: "${" + ProjectDisplayNameParam + "}",
}
ret.Objects = append(ret.Objects, project)
binding := &authorizationapi.RoleBinding{}
binding.Name = "admins"
binding.Namespace = ns
binding.Users = util.NewStringSet("${" + ProjectAdminUserParam + "}")
binding.RoleRef.Name = bootstrappolicy.AdminRoleName
ret.Objects = append(ret.Objects, binding)
serviceAccountRoleBindings := bootstrappolicy.GetBootstrapServiceAccountProjectRoleBindings(ns)
for i := range serviceAccountRoleBindings {
ret.Objects = append(ret.Objects, &serviceAccountRoleBindings[i])
}
for _, parameterName := range parameters {
parameter := templateapi.Parameter{}
parameter.Name = parameterName
ret.Parameters = append(ret.Parameters, parameter)
}
return ret
}
示例2: autoConvert_v1_Parameter_To_api_Parameter
func autoConvert_v1_Parameter_To_api_Parameter(in *Parameter, out *template_api.Parameter, s conversion.Scope) error {
out.Name = in.Name
out.DisplayName = in.DisplayName
out.Description = in.Description
out.Value = in.Value
out.Generate = in.Generate
out.From = in.From
out.Required = in.Required
return nil
}
示例3: autoConvert_v1_Parameter_To_api_Parameter
func autoConvert_v1_Parameter_To_api_Parameter(in *Parameter, out *template_api.Parameter, s conversion.Scope) error {
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
defaulting.(func(*Parameter))(in)
}
out.Name = in.Name
out.DisplayName = in.DisplayName
out.Description = in.Description
out.Value = in.Value
out.Generate = in.Generate
out.From = in.From
out.Required = in.Required
return nil
}
示例4: DefaultTemplate
func DefaultTemplate() *templateapi.Template {
ret := &templateapi.Template{}
ret.Name = DefaultTemplateName
ns := "${" + ProjectNameParam + "}"
templateContents := []runtime.Object{}
project := &projectapi.Project{}
project.Name = ns
project.Annotations = map[string]string{
projectapi.ProjectDescription: "${" + ProjectDescriptionParam + "}",
projectapi.ProjectDisplayName: "${" + ProjectDisplayNameParam + "}",
projectapi.ProjectRequester: "${" + ProjectRequesterParam + "}",
}
templateContents = append(templateContents, project)
serviceAccountRoleBindings := bootstrappolicy.GetBootstrapServiceAccountProjectRoleBindings(ns)
for i := range serviceAccountRoleBindings {
templateContents = append(templateContents, &serviceAccountRoleBindings[i])
}
binding := &authorizationapi.RoleBinding{}
binding.Name = bootstrappolicy.AdminRoleName
binding.Namespace = ns
binding.Subjects = []kapi.ObjectReference{{Kind: authorizationapi.UserKind, Name: "${" + ProjectAdminUserParam + "}"}}
binding.RoleRef.Name = bootstrappolicy.AdminRoleName
templateContents = append(templateContents, binding)
if err := templateapi.AddObjectsToTemplate(ret, templateContents, latest.Version); err != nil {
// this should never happen because we're tightly controlling what goes in.
panic(err)
}
for _, parameterName := range parameters {
parameter := templateapi.Parameter{}
parameter.Name = parameterName
ret.Parameters = append(ret.Parameters, parameter)
}
return ret
}