Added bash completion for several kubectl commands.

This path added/fixed bash completion for several
kubectl commands.

Fixes #25287
This commit is contained in:
Xing Zhou
2016-08-22 10:46:50 +08:00
parent 956501b1f0
commit 80d6cd0a40
9 changed files with 60 additions and 15 deletions

View File

@@ -66,6 +66,9 @@ var (
func NewCmdScale(f *cmdutil.Factory, out io.Writer) *cobra.Command {
options := &ScaleOptions{}
validArgs := []string{"deployment", "replicaset", "replicationcontroller", "job"}
argAliases := kubectl.ResourceAliases(validArgs)
cmd := &cobra.Command{
Use: "scale [--resource-version=version] [--current-replicas=count] --replicas=COUNT (-f FILENAME | TYPE NAME)",
// resize is deprecated
@@ -79,6 +82,8 @@ func NewCmdScale(f *cmdutil.Factory, out io.Writer) *cobra.Command {
err := RunScale(f, out, cmd, args, shortOutput, options)
cmdutil.CheckErr(err)
},
ValidArgs: validArgs,
ArgAliases: argAliases,
}
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 resource match this value in order to scale.")