当前位置: 首页>>代码示例>>Golang>>正文


Golang kubectl.DescribableResources函数代码示例

本文整理汇总了Golang中k8s/io/kubernetes/pkg/kubectl.DescribableResources函数的典型用法代码示例。如果您正苦于以下问题:Golang DescribableResources函数的具体用法?Golang DescribableResources怎么用?Golang DescribableResources使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DescribableResources函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: NewCmdDescribe

func NewCmdDescribe(f *cmdutil.Factory, out io.Writer) *cobra.Command {
	options := &DescribeOptions{}
	describerSettings := &kubectl.DescriberSettings{}

	validArgs := kubectl.DescribableResources()
	argAliases := kubectl.ResourceAliases(validArgs)

	cmd := &cobra.Command{
		Use:     "describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME)",
		Short:   "Show details of a specific resource or group of resources",
		Long:    describe_long,
		Example: describe_example,
		Run: func(cmd *cobra.Command, args []string) {
			err := RunDescribe(f, out, cmd, args, options, describerSettings)
			cmdutil.CheckErr(err)
		},
		ValidArgs:  validArgs,
		ArgAliases: argAliases,
	}
	usage := "Filename, directory, or URL to a file containing the resource to describe"
	kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage)
	cmdutil.AddRecursiveFlag(cmd, &options.Recursive)
	cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on")
	cmd.Flags().Bool("all-namespaces", false, "If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.")
	cmd.Flags().BoolVar(&describerSettings.ShowEvents, "show-events", true, "If true, display events related to the described object.")
	cmdutil.AddInclude3rdPartyFlags(cmd)
	return cmd
}
开发者ID:vmware,项目名称:kubernetes,代码行数:28,代码来源:describe.go

示例2: NewCmdDescribe

func NewCmdDescribe(f *cmdutil.Factory, out io.Writer) *cobra.Command {
	options := &DescribeOptions{}

	validArgs := kubectl.DescribableResources()
	argAliases := kubectl.ResourceAliases(validArgs)

	cmd := &cobra.Command{
		Use:     "describe (-f FILENAME | TYPE [NAME_PREFIX | -l label] | TYPE/NAME)",
		Short:   "Show details of a specific resource or group of resources",
		Long:    describe_long,
		Example: describe_example,
		Run: func(cmd *cobra.Command, args []string) {
			err := RunDescribe(f, out, cmd, args, options)
			cmdutil.CheckErr(err)
		},
		ValidArgs:  validArgs,
		ArgAliases: argAliases,
	}
	usage := "Filename, directory, or URL to a file containing the resource to describe"
	kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage)
	cmdutil.AddRecursiveFlag(cmd, &options.Recursive)
	cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on")
	cmdutil.AddInclude3rdPartyFlags(cmd)
	return cmd
}
开发者ID:Clarifai,项目名称:kubernetes,代码行数:25,代码来源:describe.go

示例3: DescribableResources

// List of all resource types we can describe
func DescribableResources() []string {
	// Include describable resources in kubernetes
	keys := kctl.DescribableResources()

	for k := range describerMap(nil, nil, "") {
		resource := strings.ToLower(k)
		keys = append(keys, resource)
	}
	return keys
}
开发者ID:dctse,项目名称:openshift-cucumber,代码行数:11,代码来源:describer.go

示例4: NewCmdDescribe

func NewCmdDescribe(f *cmdutil.Factory, out io.Writer) *cobra.Command {
	cmd := &cobra.Command{
		Use:     "describe (TYPE [(NAME_PREFIX | -l label] | TYPE/NAME)",
		Short:   "Show details of a specific resource or group of resources",
		Long:    describe_long,
		Example: describe_example,
		Run: func(cmd *cobra.Command, args []string) {
			err := RunDescribe(f, out, cmd, args)
			cmdutil.CheckErr(err)
		},
		ValidArgs: kubectl.DescribableResources(),
	}
	cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on")
	return cmd
}
开发者ID:jmferrer,项目名称:kubernetes,代码行数:15,代码来源:describe.go


注:本文中的k8s/io/kubernetes/pkg/kubectl.DescribableResources函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。