Merge pull request #97523 from pandaamanda/kubectl_alpha

code cleanup for kubectl alpha -h
This commit is contained in:
Kubernetes Prow Robot 2021-01-21 08:25:14 -08:00 committed by GitHub
commit ded5726227
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,7 +40,7 @@ func NewCmdAlpha(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.
// NewKubeletCommand() will hide the alpha command if it has no subcommands. Overriding
// the help function ensures a reasonable message if someone types the hidden command anyway.
if !cmd.HasSubCommands() {
if !cmd.HasAvailableSubCommands() {
cmd.SetHelpFunc(func(*cobra.Command, []string) {
cmd.Println(i18n.T("No alpha commands are available in this version of kubectl"))
})