本文整理匯總了Golang中k8s/io/kubernetes/pkg/kubectl/cmd.NewCmdCreate函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewCmdCreate函數的具體用法?Golang NewCmdCreate怎麽用?Golang NewCmdCreate使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了NewCmdCreate函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewCmdCreate
// NewCmdCreate is a wrapper for the Kubernetes cli create command
func NewCmdCreate(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := kcmd.NewCmdCreate(f.Factory, out)
cmd.Long = createLong
cmd.Example = fmt.Sprintf(createExample, fullName)
// create subcommands
cmd.AddCommand(NewCmdCreateRoute(fullName, f, out))
return cmd
}
示例2: NewCmdCreate
// NewCmdCreate is a wrapper for the Kubernetes cli create command
func NewCmdCreate(parentName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := kcmd.NewCmdCreate(f.Factory, out)
cmd.Long = createLong
cmd.Example = fmt.Sprintf(createExample, parentName)
// create subcommands
cmd.AddCommand(NewCmdCreateRoute(parentName, f, out))
cmd.AddCommand(create.NewCmdCreatePolicyBinding(create.PolicyBindingRecommendedName, parentName+" create "+create.PolicyBindingRecommendedName, f, out))
cmd.AddCommand(create.NewCmdCreateDeploymentConfig(create.DeploymentConfigRecommendedName, parentName+" create "+create.DeploymentConfigRecommendedName, f, out))
cmd.AddCommand(create.NewCmdCreateUser(create.UserRecommendedName, parentName+" create "+create.UserRecommendedName, f, out))
cmd.AddCommand(create.NewCmdCreateIdentity(create.IdentityRecommendedName, parentName+" create "+create.IdentityRecommendedName, f, out))
cmd.AddCommand(create.NewCmdCreateUserIdentityMapping(create.UserIdentityMappingRecommendedName, parentName+" create "+create.UserIdentityMappingRecommendedName, f, out))
adjustCmdExamples(cmd, parentName, "create")
return cmd
}
示例3: NewCmdCreate
// NewCmdCreate is a wrapper for the Kubernetes cli create command
func NewCmdCreate(parentName string, f *clientcmd.Factory, out, errOut io.Writer) *cobra.Command {
cmd := kcmd.NewCmdCreate(f.Factory, out, errOut)
cmd.Long = createLong
cmd.Example = fmt.Sprintf(createExample, parentName)
// normalize long descs and examples
// TODO remove when normalization is moved upstream
templates.NormalizeAll(cmd)
// create subcommands
cmd.AddCommand(create.NewCmdCreateRoute(parentName, f, out, errOut))
cmd.AddCommand(create.NewCmdCreatePolicyBinding(create.PolicyBindingRecommendedName, parentName+" create "+create.PolicyBindingRecommendedName, f, out))
cmd.AddCommand(create.NewCmdCreateDeploymentConfig(create.DeploymentConfigRecommendedName, parentName+" create "+create.DeploymentConfigRecommendedName, f, out))
cmd.AddCommand(create.NewCmdCreateClusterQuota(create.ClusterQuotaRecommendedName, parentName+" create "+create.ClusterQuotaRecommendedName, f, out))
cmd.AddCommand(create.NewCmdCreateUser(create.UserRecommendedName, parentName+" create "+create.UserRecommendedName, f, out))
cmd.AddCommand(create.NewCmdCreateIdentity(create.IdentityRecommendedName, parentName+" create "+create.IdentityRecommendedName, f, out))
cmd.AddCommand(create.NewCmdCreateUserIdentityMapping(create.UserIdentityMappingRecommendedName, parentName+" create "+create.UserIdentityMappingRecommendedName, f, out))
cmd.AddCommand(create.NewCmdCreateImageStream(create.ImageStreamRecommendedName, parentName+" create "+create.ImageStreamRecommendedName, f, out))
adjustCmdExamples(cmd, parentName, "create")
return cmd
}