Merge pull request #39218 from luksa/kubectl_top_short_forms

Automatic merge from submit-queue

Kubectl top now also accepts short forms for "node" and "pod" ("no", "po")

**What this PR does / why we need it**:
People are used to typing `kubectl get po` and will expect `kubectl top po` to also work (without having to type the full resource name).
This commit is contained in:
Kubernetes Submit Queue 2016-12-28 15:47:11 -08:00 committed by GitHub
commit 3a2492f4d6
2 changed files with 2 additions and 2 deletions

View File

@ -88,7 +88,7 @@ func NewCmdTopNode(f cmdutil.Factory, out io.Writer) *cobra.Command {
cmdutil.CheckErr(err)
}
},
Aliases: []string{"nodes"},
Aliases: []string{"nodes", "no"},
}
cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.")
options.HeapsterOptions.Bind(cmd.Flags())

View File

@ -90,7 +90,7 @@ func NewCmdTopPod(f cmdutil.Factory, out io.Writer) *cobra.Command {
cmdutil.CheckErr(err)
}
},
Aliases: []string{"pods"},
Aliases: []string{"pods", "po"},
}
cmd.Flags().StringVarP(&options.Selector, "selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.")
cmd.Flags().BoolVar(&options.PrintContainers, "containers", false, "If present, print usage of containers within a pod.")