mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Merge pull request #13850 from feihujiang/enhanceErrorMessageForScaleRepicasOperationRequired
Auto commit by PR queue bot
This commit is contained in:
commit
916472f65d
@ -76,8 +76,8 @@ func NewCmdScale(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
|||||||
cmd.Flags().String("resource-version", "", "Precondition for resource version. Requires that the current resource version match this value in order to scale.")
|
cmd.Flags().String("resource-version", "", "Precondition for resource version. Requires that the current resource version match this value in order to scale.")
|
||||||
cmd.Flags().Int("current-replicas", -1, "Precondition for current size. Requires that the current size of the replication controller match this value in order to scale.")
|
cmd.Flags().Int("current-replicas", -1, "Precondition for current size. Requires that the current size of the replication controller match this value in order to scale.")
|
||||||
cmd.Flags().Int("replicas", -1, "The new desired number of replicas. Required.")
|
cmd.Flags().Int("replicas", -1, "The new desired number of replicas. Required.")
|
||||||
cmd.Flags().Duration("timeout", 0, "The length of time to wait before giving up on a scale operation, zero means don't wait.")
|
|
||||||
cmd.MarkFlagRequired("replicas")
|
cmd.MarkFlagRequired("replicas")
|
||||||
|
cmd.Flags().Duration("timeout", 0, "The length of time to wait before giving up on a scale operation, zero means don't wait.")
|
||||||
cmdutil.AddOutputFlagsForMutation(cmd)
|
cmdutil.AddOutputFlagsForMutation(cmd)
|
||||||
|
|
||||||
usage := "Filename, directory, or URL to a file identifying the replication controller to set a new size"
|
usage := "Filename, directory, or URL to a file identifying the replication controller to set a new size"
|
||||||
@ -93,7 +93,7 @@ func RunScale(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri
|
|||||||
|
|
||||||
count := cmdutil.GetFlagInt(cmd, "replicas")
|
count := cmdutil.GetFlagInt(cmd, "replicas")
|
||||||
if count < 0 {
|
if count < 0 {
|
||||||
return cmdutil.UsageError(cmd, "--replicas=COUNT TYPE NAME")
|
return cmdutil.UsageError(cmd, "--replicas=COUNT is required, and COUNT must be greater than or equal to 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
cmdNamespace, enforceNamespace, err := f.DefaultNamespace()
|
cmdNamespace, enforceNamespace, err := f.DefaultNamespace()
|
||||||
|
Loading…
Reference in New Issue
Block a user