Skip to content

Commit 433c6be

Browse files
author
Kubernetes Submit Queue
authored
Merge pull request kubernetes#37066 from xilabao/update-label-filter-prompt
Automatic merge from submit-queue update label filter prompt I have to look up the meaning of selector in docs/user-guide/labels.md. I think we could print more info when run "--help".
2 parents 8117722 + b95dcfb commit 433c6be

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

pkg/kubectl/cmd/annotate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func NewCmdAnnotate(f cmdutil.Factory, out io.Writer) *cobra.Command {
125125
cmdutil.AddPrinterFlags(cmd)
126126
cmd.Flags().Bool("overwrite", false, "If true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations.")
127127
cmd.Flags().Bool("local", false, "If true, annotation will NOT contact api-server but run locally.")
128-
cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on")
128+
cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.")
129129
cmd.Flags().Bool("all", false, "select all resources in the namespace of the specified resource types")
130130
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.")
131131
usage := "identifying the resource to update the annotation"

pkg/kubectl/cmd/apply.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func NewCmdApply(f cmdutil.Factory, out io.Writer) *cobra.Command {
114114
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))
115115
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).")
116116
cmdutil.AddValidateFlags(cmd)
117-
cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on")
117+
cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.")
118118
cmd.Flags().Bool("all", false, "[-all] to select all the specified resources.")
119119
cmd.Flags().StringArray("prune-whitelist", []string{}, "Overwrite the default whitelist with <group/version/kind> for --prune")
120120
cmdutil.AddDryRunFlag(cmd)

pkg/kubectl/cmd/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func NewCmdDescribe(f cmdutil.Factory, out, cmdErr io.Writer) *cobra.Command {
8888
}
8989
usage := "containing the resource to describe"
9090
cmdutil.AddFilenameOptionFlags(cmd, options, usage)
91-
cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on")
91+
cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.")
9292
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.")
9393
cmd.Flags().BoolVar(&describerSettings.ShowEvents, "show-events", true, "If true, display events related to the described object.")
9494
cmdutil.AddInclude3rdPartyFlags(cmd)

pkg/kubectl/cmd/get.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func NewCmdGet(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Comman
113113
ArgAliases: argAliases,
114114
}
115115
cmdutil.AddPrinterFlags(cmd)
116-
cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on")
116+
cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.")
117117
cmd.Flags().BoolP("watch", "w", false, "After listing/getting the requested object, watch for changes.")
118118
cmd.Flags().Bool("watch-only", false, "Watch for changes to the requested object(s), without listing/getting first.")
119119
cmd.Flags().Bool("show-kind", false, "If present, list the resource type for the requested object(s).")

pkg/kubectl/cmd/label.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func NewCmdLabel(f cmdutil.Factory, out io.Writer) *cobra.Command {
123123
cmdutil.AddPrinterFlags(cmd)
124124
cmd.Flags().Bool("overwrite", false, "If true, allow labels to be overwritten, otherwise reject label updates that overwrite existing labels.")
125125
cmd.Flags().Bool("local", false, "If true, label will NOT contact api-server but run locally.")
126-
cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on")
126+
cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.")
127127
cmd.Flags().Bool("all", false, "select all resources in the namespace of the specified resource types")
128128
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.")
129129
usage := "identifying the resource to update the labels"

pkg/kubectl/cmd/set/set_image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func NewCmdImage(f cmdutil.Factory, out, err io.Writer) *cobra.Command {
101101
usage := "identifying the resource to get from a server."
102102
cmdutil.AddFilenameOptionFlags(cmd, &options.FilenameOptions, usage)
103103
cmd.Flags().BoolVar(&options.All, "all", false, "select all resources in the namespace of the specified resource types")
104-
cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on")
104+
cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.")
105105
cmd.Flags().BoolVar(&options.Local, "local", false, "If true, set image will NOT contact api-server but run locally.")
106106
cmdutil.AddRecordFlag(cmd)
107107
return cmd

pkg/kubectl/cmd/set/set_resources.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var (
3838
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.
3939
4040
for each compute resource, if a limit is specified and a request is omitted, the request will default to the limit.
41-
41+
4242
Possible resources include (case insensitive): %s.`)
4343

4444
resources_example = templates.Examples(`
@@ -113,7 +113,7 @@ func NewCmdResources(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.
113113
usage := "identifying the resource to get from a server."
114114
cmdutil.AddFilenameOptionFlags(cmd, &options.FilenameOptions, usage)
115115
cmd.Flags().BoolVar(&options.All, "all", false, "select all resources in the namespace of the specified resource types")
116-
cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on")
116+
cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.")
117117
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")
118118
cmd.Flags().BoolVar(&options.Local, "local", false, "If true, set resources will NOT contact api-server but run locally.")
119119
cmdutil.AddDryRunFlag(cmd)

pkg/kubectl/cmd/taint.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func NewCmdTaint(f cmdutil.Factory, out io.Writer) *cobra.Command {
103103

104104
cmdutil.AddPrinterFlags(cmd)
105105
cmdutil.AddInclude3rdPartyFlags(cmd)
106-
cmd.Flags().StringVarP(&options.selector, "selector", "l", "", "Selector (label query) to filter on")
106+
cmd.Flags().StringVarP(&options.selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.")
107107
cmd.Flags().BoolVar(&options.overwrite, "overwrite", false, "If true, allow taints to be overwritten, otherwise reject taint updates that overwrite existing taints.")
108108
cmd.Flags().BoolVar(&options.all, "all", false, "select all nodes in the cluster")
109109
return cmd

pkg/kubectl/cmd/top_node.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func NewCmdTopNode(f cmdutil.Factory, out io.Writer) *cobra.Command {
8989
},
9090
Aliases: []string{"nodes"},
9191
}
92-
cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on")
92+
cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.")
9393
options.HeapsterOptions.Bind(cmd.Flags())
9494
return cmd
9595
}

pkg/kubectl/cmd/top_pod.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func NewCmdTopPod(f cmdutil.Factory, out io.Writer) *cobra.Command {
9191
},
9292
Aliases: []string{"pods"},
9393
}
94-
cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on")
94+
cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.")
9595
cmd.Flags().BoolVar(&options.PrintContainers, "containers", false, "If present, print usage of containers within a pod.")
9696
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.")
9797
options.HeapsterOptions.Bind(cmd.Flags())

0 commit comments

Comments
 (0)