low hanging fruit for using cobra commands

This commit is contained in:
David Eads
2018-01-17 13:41:01 -05:00
parent 8a6bb3e120
commit d7ddcca231
20 changed files with 111 additions and 101 deletions

View File

@@ -19,6 +19,7 @@ package cmd
import (
"fmt"
"io"
"os"
"k8s.io/apiserver/pkg/util/flag"
"k8s.io/client-go/tools/clientcmd"
@@ -212,6 +213,10 @@ var (
}
)
func NewDefaultKubectlCommand() *cobra.Command {
return NewKubectlCommand(cmdutil.NewFactory(nil), os.Stdin, os.Stdout, os.Stderr)
}
// NewKubectlCommand creates the `kubectl` command and its nested children.
func NewKubectlCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cobra.Command {
// Parent command to which all subcommands are added.