cmd.Flags().BoolVar(&o.overwrite,"overwrite",o.overwrite,"If true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations.")
cmd.Flags().BoolVar(&o.overwrite,"overwrite",o.overwrite,"If true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations.")
cmd.Flags().BoolVar(&o.local,"local",o.local,"If true, annotation will NOT contact api-server but run locally.")
cmd.Flags().BoolVar(&o.local,"local",o.local,"If true, annotation will NOT contact api-server but run locally.")
cmd.Flags().StringVarP(&o.selector,"selector","l",o.selector,"Selector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2).")
cmd.Flags().StringVarP(&o.selector,"selector","l",o.selector,"Selector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2).")
cmd.Flags().StringVar(&o.fieldSelector,"field-selector",o.fieldSelector,"Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.")
cmd.Flags().BoolVar(&o.all,"all",o.all,"Select all resources, including uninitialized ones, in the namespace of the specified resource types.")
cmd.Flags().BoolVar(&o.all,"all",o.all,"Select all resources, including uninitialized ones, in the namespace of the specified resource types.")
cmd.Flags().StringVar(&o.resourceVersion,"resource-version",o.resourceVersion,i18n.T("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."))
cmd.Flags().StringVar(&o.resourceVersion,"resource-version",o.resourceVersion,i18n.T("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"
usage:="identifying the resource to update the annotation"
...
@@ -175,6 +177,9 @@ func (o AnnotateOptions) Validate() error {
...
@@ -175,6 +177,9 @@ func (o AnnotateOptions) Validate() error {
ifo.all&&len(o.selector)>0{
ifo.all&&len(o.selector)>0{
returnfmt.Errorf("cannot set --all and --selector at the same time")
returnfmt.Errorf("cannot set --all and --selector at the same time")
}
}
ifo.all&&len(o.fieldSelector)>0{
returnfmt.Errorf("cannot set --all and --field-selector at the same time")
cmd.Flags().StringVarP(f.LabelSelector,"selector","l",*f.LabelSelector,"Selector (label query) to filter on, not including uninitialized ones.")
}
iff.FieldSelector!=nil{
cmd.Flags().StringVarP(f.FieldSelector,"field-selector","",*f.FieldSelector,"Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.")
}
iff.All!=nil{
iff.All!=nil{
cmd.Flags().BoolVar(f.All,"all",*f.All,"Delete all resources, including uninitialized ones, in the namespace of the specified resource types.")
cmd.Flags().BoolVar(f.All,"all",*f.All,"Delete all resources, including uninitialized ones, in the namespace of the specified resource types.")
cmd.Flags().BoolVar(&o.list,"list",o.list,"If true, display the labels for a given resource.")
cmd.Flags().BoolVar(&o.list,"list",o.list,"If true, display the labels for a given resource.")
cmd.Flags().BoolVar(&o.local,"local",o.local,"If true, label will NOT contact api-server but run locally.")
cmd.Flags().BoolVar(&o.local,"local",o.local,"If true, label will NOT contact api-server but run locally.")
cmd.Flags().StringVarP(&o.selector,"selector","l",o.selector,"Selector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2).")
cmd.Flags().StringVarP(&o.selector,"selector","l",o.selector,"Selector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2).")
cmd.Flags().StringVar(&o.fieldSelector,"field-selector",o.fieldSelector,"Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type.")
cmd.Flags().BoolVar(&o.all,"all",o.all,"Select all resources, including uninitialized ones, in the namespace of the specified resource types")
cmd.Flags().BoolVar(&o.all,"all",o.all,"Select all resources, including uninitialized ones, in the namespace of the specified resource types")
cmd.Flags().StringVar(&o.resourceVersion,"resource-version",o.resourceVersion,i18n.T("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."))
cmd.Flags().StringVar(&o.resourceVersion,"resource-version",o.resourceVersion,i18n.T("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"
usage:="identifying the resource to update the labels"
...
@@ -184,6 +186,9 @@ func (o *LabelOptions) Validate() error {
...
@@ -184,6 +186,9 @@ func (o *LabelOptions) Validate() error {
ifo.all&&len(o.selector)>0{
ifo.all&&len(o.selector)>0{
returnfmt.Errorf("cannot set --all and --selector at the same time")
returnfmt.Errorf("cannot set --all and --selector at the same time")
}
}
ifo.all&&len(o.fieldSelector)>0{
returnfmt.Errorf("cannot set --all and --field-selector at the same time")