update more commands for iostreams
This commit is contained in:
@@ -18,7 +18,6 @@ package set
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"k8s.io/kubernetes/pkg/printers"
|
||||
|
||||
@@ -45,8 +44,6 @@ type SetImageOptions struct {
|
||||
|
||||
Infos []*resource.Info
|
||||
Selector string
|
||||
Out io.Writer
|
||||
Err io.Writer
|
||||
DryRun bool
|
||||
All bool
|
||||
Output string
|
||||
@@ -59,6 +56,8 @@ type SetImageOptions struct {
|
||||
UpdatePodSpecForObject func(obj runtime.Object, fn func(*v1.PodSpec) error) (bool, error)
|
||||
Resources []string
|
||||
ContainerImages map[string]string
|
||||
|
||||
genericclioptions.IOStreams
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -85,20 +84,19 @@ var (
|
||||
kubectl set image -f path/to/file.yaml nginx=nginx:1.9.1 --local -o yaml`)
|
||||
)
|
||||
|
||||
func NewImageOptions(out, errOut io.Writer) *SetImageOptions {
|
||||
func NewImageOptions(streams genericclioptions.IOStreams) *SetImageOptions {
|
||||
return &SetImageOptions{
|
||||
PrintFlags: printers.NewPrintFlags("image updated"),
|
||||
RecordFlags: genericclioptions.NewRecordFlags(),
|
||||
|
||||
Recorder: genericclioptions.NoopRecorder{},
|
||||
|
||||
Out: out,
|
||||
Err: errOut,
|
||||
IOStreams: streams,
|
||||
}
|
||||
}
|
||||
|
||||
func NewCmdImage(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command {
|
||||
o := NewImageOptions(out, errOut)
|
||||
func NewCmdImage(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command {
|
||||
o := NewImageOptions(streams)
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "image (-f FILENAME | TYPE NAME) CONTAINER_NAME_1=CONTAINER_IMAGE_1 ... CONTAINER_NAME_N=CONTAINER_IMAGE_N",
|
||||
|
||||
Reference in New Issue
Block a user