當前位置: 首頁>>代碼示例>>Golang>>正文


Golang cmd.NewCmdCreate函數代碼示例

本文整理匯總了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
}
開發者ID:rrati,項目名稱:origin,代碼行數:10,代碼來源:wrappers.go

示例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
}
開發者ID:RomainVabre,項目名稱:origin,代碼行數:19,代碼來源:wrappers.go

示例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
}
開發者ID:juanluisvaladas,項目名稱:origin,代碼行數:25,代碼來源:wrappers.go


注:本文中的k8s/io/kubernetes/pkg/kubectl/cmd.NewCmdCreate函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。