update more commands for iostreams

This commit is contained in:
David Eads
2018-04-25 08:32:08 -04:00
parent 3fb88a23d9
commit 8c1b687356
24 changed files with 241 additions and 262 deletions

View File

@@ -17,11 +17,10 @@ limitations under the License.
package set
import (
"io"
"github.com/spf13/cobra"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/genericclioptions"
"k8s.io/kubernetes/pkg/kubectl/util/i18n"
)
@@ -32,22 +31,22 @@ var (
These commands help you make changes to existing application resources.`)
)
func NewCmdSet(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cobra.Command {
func NewCmdSet(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command {
cmd := &cobra.Command{
Use: "set SUBCOMMAND",
DisableFlagsInUseLine: true,
Short: i18n.T("Set specific features on objects"),
Long: set_long,
Run: cmdutil.DefaultSubCommandRun(err),
Run: cmdutil.DefaultSubCommandRun(streams.ErrOut),
}
// add subcommands
cmd.AddCommand(NewCmdImage(f, out, err))
cmd.AddCommand(NewCmdResources(f, out, err))
cmd.AddCommand(NewCmdSelector(f, out))
cmd.AddCommand(NewCmdSubject(f, out, err))
cmd.AddCommand(NewCmdServiceAccount(f, out, err))
cmd.AddCommand(NewCmdEnv(f, in, out, err))
cmd.AddCommand(NewCmdImage(f, streams))
cmd.AddCommand(NewCmdResources(f, streams))
cmd.AddCommand(NewCmdSelector(f, streams))
cmd.AddCommand(NewCmdSubject(f, streams))
cmd.AddCommand(NewCmdServiceAccount(f, streams))
cmd.AddCommand(NewCmdEnv(f, streams))
return cmd
}