diff --git a/pkg/kubectl/cmd/annotate.go b/pkg/kubectl/cmd/annotate.go index 6562ab5a6ee..769b80b31d8 100644 --- a/pkg/kubectl/cmd/annotate.go +++ b/pkg/kubectl/cmd/annotate.go @@ -125,7 +125,7 @@ func NewCmdAnnotate(f cmdutil.Factory, out io.Writer) *cobra.Command { cmdutil.AddPrinterFlags(cmd) cmd.Flags().Bool("overwrite", false, "If true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations.") cmd.Flags().Bool("local", false, "If true, annotation will NOT contact api-server but run locally.") - cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on") + cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.") cmd.Flags().Bool("all", false, "select all resources in the namespace of the specified resource types") cmd.Flags().String("resource-version", "", "If non-empty, the annotation update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.") usage := "identifying the resource to update the annotation" diff --git a/pkg/kubectl/cmd/apply.go b/pkg/kubectl/cmd/apply.go index 9ec2dac0d22..f337b13eb64 100644 --- a/pkg/kubectl/cmd/apply.go +++ b/pkg/kubectl/cmd/apply.go @@ -114,7 +114,7 @@ func NewCmdApply(f cmdutil.Factory, out io.Writer) *cobra.Command { cmd.Flags().BoolVar(&options.Force, "force", false, fmt.Sprintf("Delete and re-create the specified resource, when PATCH encounters conflict and has retried for %d times.", maxPatchRetry)) cmd.Flags().DurationVar(&options.Timeout, "timeout", 0, "Only relevant during a force apply. The length of time to wait before giving up on a delete of the old resource, zero means determine a timeout from the size of the object. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h).") cmdutil.AddValidateFlags(cmd) - cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on") + cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.") cmd.Flags().Bool("all", false, "[-all] to select all the specified resources.") cmd.Flags().StringArray("prune-whitelist", []string{}, "Overwrite the default whitelist with for --prune") cmdutil.AddDryRunFlag(cmd) diff --git a/pkg/kubectl/cmd/describe.go b/pkg/kubectl/cmd/describe.go index ee464c65ada..3f02427e973 100644 --- a/pkg/kubectl/cmd/describe.go +++ b/pkg/kubectl/cmd/describe.go @@ -88,7 +88,7 @@ func NewCmdDescribe(f cmdutil.Factory, out, cmdErr io.Writer) *cobra.Command { } usage := "containing the resource to describe" cmdutil.AddFilenameOptionFlags(cmd, options, usage) - cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on") + cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.") 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) diff --git a/pkg/kubectl/cmd/get.go b/pkg/kubectl/cmd/get.go index 889ee9d2c02..a56cb655224 100644 --- a/pkg/kubectl/cmd/get.go +++ b/pkg/kubectl/cmd/get.go @@ -113,7 +113,7 @@ func NewCmdGet(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Comman ArgAliases: argAliases, } cmdutil.AddPrinterFlags(cmd) - cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on") + cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.") cmd.Flags().BoolP("watch", "w", false, "After listing/getting the requested object, watch for changes.") cmd.Flags().Bool("watch-only", false, "Watch for changes to the requested object(s), without listing/getting first.") cmd.Flags().Bool("show-kind", false, "If present, list the resource type for the requested object(s).") diff --git a/pkg/kubectl/cmd/label.go b/pkg/kubectl/cmd/label.go index 99e853056d9..ee137b73dc4 100644 --- a/pkg/kubectl/cmd/label.go +++ b/pkg/kubectl/cmd/label.go @@ -123,7 +123,7 @@ func NewCmdLabel(f cmdutil.Factory, out io.Writer) *cobra.Command { cmdutil.AddPrinterFlags(cmd) cmd.Flags().Bool("overwrite", false, "If true, allow labels to be overwritten, otherwise reject label updates that overwrite existing labels.") cmd.Flags().Bool("local", false, "If true, label will NOT contact api-server but run locally.") - cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on") + cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.") cmd.Flags().Bool("all", false, "select all resources in the namespace of the specified resource types") cmd.Flags().String("resource-version", "", "If non-empty, the labels update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.") usage := "identifying the resource to update the labels" diff --git a/pkg/kubectl/cmd/set/set_image.go b/pkg/kubectl/cmd/set/set_image.go index 5baa00b3d43..c303883d90f 100644 --- a/pkg/kubectl/cmd/set/set_image.go +++ b/pkg/kubectl/cmd/set/set_image.go @@ -101,7 +101,7 @@ func NewCmdImage(f cmdutil.Factory, out, err io.Writer) *cobra.Command { usage := "identifying the resource to get from a server." cmdutil.AddFilenameOptionFlags(cmd, &options.FilenameOptions, usage) cmd.Flags().BoolVar(&options.All, "all", false, "select all resources in the namespace of the specified resource types") - cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on") + cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.") cmd.Flags().BoolVar(&options.Local, "local", false, "If true, set image will NOT contact api-server but run locally.") cmdutil.AddRecordFlag(cmd) return cmd diff --git a/pkg/kubectl/cmd/set/set_resources.go b/pkg/kubectl/cmd/set/set_resources.go index 9d991242746..8885a6580a9 100644 --- a/pkg/kubectl/cmd/set/set_resources.go +++ b/pkg/kubectl/cmd/set/set_resources.go @@ -38,7 +38,7 @@ var ( Specify compute resource requirements (cpu, memory) for any resource that defines a pod template. If a pod is successfully scheduled, it is guaranteed the amount of resource requested, but may burst up to its specified limits. for each compute resource, if a limit is specified and a request is omitted, the request will default to the limit. - + Possible resources include (case insensitive): %s.`) resources_example = templates.Examples(` @@ -113,7 +113,7 @@ func NewCmdResources(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra. usage := "identifying the resource to get from a server." cmdutil.AddFilenameOptionFlags(cmd, &options.FilenameOptions, usage) cmd.Flags().BoolVar(&options.All, "all", false, "select all resources in the namespace of the specified resource types") - cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on") + cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.") cmd.Flags().StringVarP(&options.ContainerSelector, "containers", "c", "*", "The names of containers in the selected pod templates to change, all containers are selected by default - may use wildcards") cmd.Flags().BoolVar(&options.Local, "local", false, "If true, set resources will NOT contact api-server but run locally.") cmdutil.AddDryRunFlag(cmd) diff --git a/pkg/kubectl/cmd/taint.go b/pkg/kubectl/cmd/taint.go index 142137f587d..6961dc31145 100644 --- a/pkg/kubectl/cmd/taint.go +++ b/pkg/kubectl/cmd/taint.go @@ -103,7 +103,7 @@ func NewCmdTaint(f cmdutil.Factory, out io.Writer) *cobra.Command { cmdutil.AddPrinterFlags(cmd) cmdutil.AddInclude3rdPartyFlags(cmd) - cmd.Flags().StringVarP(&options.selector, "selector", "l", "", "Selector (label query) to filter on") + cmd.Flags().StringVarP(&options.selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.") cmd.Flags().BoolVar(&options.overwrite, "overwrite", false, "If true, allow taints to be overwritten, otherwise reject taint updates that overwrite existing taints.") cmd.Flags().BoolVar(&options.all, "all", false, "select all nodes in the cluster") return cmd diff --git a/pkg/kubectl/cmd/top_node.go b/pkg/kubectl/cmd/top_node.go index 4100ad64959..657edb062a4 100644 --- a/pkg/kubectl/cmd/top_node.go +++ b/pkg/kubectl/cmd/top_node.go @@ -89,7 +89,7 @@ func NewCmdTopNode(f cmdutil.Factory, out io.Writer) *cobra.Command { }, Aliases: []string{"nodes"}, } - cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on") + cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.") options.HeapsterOptions.Bind(cmd.Flags()) return cmd } diff --git a/pkg/kubectl/cmd/top_pod.go b/pkg/kubectl/cmd/top_pod.go index 61041b3b088..75553f5701a 100644 --- a/pkg/kubectl/cmd/top_pod.go +++ b/pkg/kubectl/cmd/top_pod.go @@ -91,7 +91,7 @@ func NewCmdTopPod(f cmdutil.Factory, out io.Writer) *cobra.Command { }, Aliases: []string{"pods"}, } - cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on") + cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.") cmd.Flags().BoolVar(&options.PrintContainers, "containers", false, "If present, print usage of containers within a pod.") cmd.Flags().BoolVar(&options.AllNamespaces, "all-namespaces", false, "If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.") options.HeapsterOptions.Bind(cmd.Flags())