diff --git a/docs/user-guide/kubectl/kubectl_stop.md b/docs/user-guide/kubectl/kubectl_stop.md index 57fa8e3b6e2..5d48aede891 100644 --- a/docs/user-guide/kubectl/kubectl_stop.md +++ b/docs/user-guide/kubectl/kubectl_stop.md @@ -36,7 +36,7 @@ $ kubectl stop -f path/to/resources ### Options ``` - --all[=false]: [-all] to select all the specified resources. + --all[=false]: select all resources in the namespace of the specified resource types. -f, --filename=[]: Filename, directory, or URL to file of resource(s) to be stopped. --grace-period=-1: Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. --ignore-not-found[=false]: Treat "resource not found" as a successful stop. diff --git a/pkg/kubectl/cmd/apply.go b/pkg/kubectl/cmd/apply.go index e0cb45759c1..4ffc958ae18 100644 --- a/pkg/kubectl/cmd/apply.go +++ b/pkg/kubectl/cmd/apply.go @@ -122,7 +122,7 @@ func NewCmdApply(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command { 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, supports '=', '==', and '!='.") - cmd.Flags().Bool("all", false, "[-all] to select all the specified resources.") + cmd.Flags().Bool("all", false, "select all resources in the namespace of the specified resource types.") cmd.Flags().StringArray("prune-whitelist", []string{}, "Overwrite the default whitelist with for --prune") cmdutil.AddDryRunFlag(cmd) cmdutil.AddPrinterFlags(cmd) diff --git a/pkg/kubectl/cmd/apply_view_last_applied.go b/pkg/kubectl/cmd/apply_view_last_applied.go index 1a7661ee3c3..1600c3b7013 100644 --- a/pkg/kubectl/cmd/apply_view_last_applied.go +++ b/pkg/kubectl/cmd/apply_view_last_applied.go @@ -36,6 +36,7 @@ type ViewLastAppliedOptions struct { Selector string LastAppliedConfigurationList []string OutputFormat string + All bool Factory cmdutil.Factory Out io.Writer ErrOut io.Writer @@ -73,6 +74,7 @@ func NewCmdApplyViewLastApplied(f cmdutil.Factory, out, err io.Writer) *cobra.Co cmd.Flags().StringP("output", "o", "", "Output format. Must be one of yaml|json") cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.") + cmd.Flags().BoolVar(&options.All, "all", false, "select all resources in the namespace of the specified resource types") usage := "that contains the last-applied-configuration annotations" cmdutil.AddFilenameOptionFlags(cmd, &options.FilenameOptions, usage) @@ -94,6 +96,7 @@ func (o *ViewLastAppliedOptions) Complete(f cmdutil.Factory, args []string) erro NamespaceParam(cmdNamespace).DefaultNamespace(). FilenameParam(enforceNamespace, &o.FilenameOptions). ResourceTypeOrNameArgs(enforceNamespace, args...). + SelectAllParam(o.All). SelectorParam(o.Selector). Latest(). Flatten(). diff --git a/pkg/kubectl/cmd/delete.go b/pkg/kubectl/cmd/delete.go index 3507d85c6a6..e662c72a136 100644 --- a/pkg/kubectl/cmd/delete.go +++ b/pkg/kubectl/cmd/delete.go @@ -151,7 +151,7 @@ func NewCmdDelete(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command { usage := "containing the resource to delete." cmdutil.AddFilenameOptionFlags(cmd, &options.FilenameOptions, usage) cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on.") - cmd.Flags().BoolVar(&options.DeleteAll, "all", false, "[-all] to select all the specified resources.") + cmd.Flags().BoolVar(&options.DeleteAll, "all", false, "select all resources in the namespace of the specified resource types.") cmd.Flags().BoolVar(&options.IgnoreNotFound, "ignore-not-found", false, "Treat \"resource not found\" as a successful delete. Defaults to \"true\" when --all is specified.") cmd.Flags().BoolVar(&options.Cascade, "cascade", true, "If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true.") cmd.Flags().IntVar(&options.GracePeriod, "grace-period", -1, "Period of time in seconds given to the resource to terminate gracefully. Ignored if negative.") diff --git a/pkg/kubectl/cmd/stop.go b/pkg/kubectl/cmd/stop.go index 74bcc4753b3..1d1d79b121e 100644 --- a/pkg/kubectl/cmd/stop.go +++ b/pkg/kubectl/cmd/stop.go @@ -68,7 +68,7 @@ func NewCmdStop(f cmdutil.Factory, out io.Writer) *cobra.Command { usage := "of resource(s) to be stopped." cmdutil.AddFilenameOptionFlags(cmd, options, usage) cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on.") - cmd.Flags().Bool("all", false, "[-all] to select all the specified resources.") + cmd.Flags().Bool("all", false, "select all resources in the namespace of the specified resource types.") cmd.Flags().Bool("ignore-not-found", false, "Treat \"resource not found\" as a successful stop.") cmd.Flags().Int("grace-period", -1, "Period of time in seconds given to the resource to terminate gracefully. Ignored if negative.") cmd.Flags().Duration("timeout", 0, "The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object")