Commit 3a2492f4 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

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).
parents 80f07b47 764e8bd6
......@@ -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())
......
......@@ -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.")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment