Merge pull request #70412 from Pingan2017/kubectl-top

code cleanup for kubectl top
pull/58/head
k8s-ci-robot 2018-11-01 15:17:55 -07:00 committed by GitHub
commit bce51cc574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 18 deletions

View File

@ -106,15 +106,9 @@ func NewCmdTopNode(f cmdutil.Factory, o *TopNodeOptions, streams genericclioptio
Long: topNodeLong,
Example: topNodeExample,
Run: func(cmd *cobra.Command, args []string) {
if err := o.Complete(f, cmd, args); err != nil {
cmdutil.CheckErr(err)
}
if err := o.Validate(); err != nil {
cmdutil.CheckErr(cmdutil.UsageErrorf(cmd, "%v", err))
}
if err := o.RunTopNode(); err != nil {
cmdutil.CheckErr(err)
}
cmdutil.CheckErr(o.Complete(f, cmd, args))
cmdutil.CheckErr(o.Validate())
cmdutil.CheckErr(o.RunTopNode())
},
Aliases: []string{"nodes", "no"},
}

View File

@ -95,15 +95,9 @@ func NewCmdTopPod(f cmdutil.Factory, o *TopPodOptions, streams genericclioptions
Long: topPodLong,
Example: topPodExample,
Run: func(cmd *cobra.Command, args []string) {
if err := o.Complete(f, cmd, args); err != nil {
cmdutil.CheckErr(err)
}
if err := o.Validate(); err != nil {
cmdutil.CheckErr(cmdutil.UsageErrorf(cmd, "%v", err))
}
if err := o.RunTopPod(); err != nil {
cmdutil.CheckErr(err)
}
cmdutil.CheckErr(o.Complete(f, cmd, args))
cmdutil.CheckErr(o.Validate())
cmdutil.CheckErr(o.RunTopPod())
},
Aliases: []string{"pods", "po"},
}