mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
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:
commit
3a2492f4d6
@ -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.")
|
||||
|
Loading…
Reference in New Issue
Block a user