wire printflags through additional cmds
This commit is contained in:
@@ -36,6 +36,7 @@ import (
|
||||
"k8s.io/client-go/rest/fake"
|
||||
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||
cmdtesting "k8s.io/kubernetes/pkg/kubectl/cmd/testing"
|
||||
"k8s.io/kubernetes/pkg/kubectl/genericclioptions"
|
||||
"k8s.io/kubernetes/pkg/kubectl/scheme"
|
||||
)
|
||||
|
||||
@@ -526,7 +527,8 @@ func TestCopyToPod(t *testing.T) {
|
||||
tf.ClientConfigVal = defaultClientConfig()
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
errBuf := bytes.NewBuffer([]byte{})
|
||||
cmd := NewCmdCp(tf, buf, errBuf)
|
||||
|
||||
cmd := NewCmdCp(tf, genericclioptions.IOStreams{Out: buf, ErrOut: errBuf})
|
||||
|
||||
srcFile, err := ioutil.TempDir("", "test")
|
||||
if err != nil {
|
||||
@@ -554,6 +556,7 @@ func TestCopyToPod(t *testing.T) {
|
||||
}
|
||||
|
||||
for name, test := range tests {
|
||||
opts := NewCopyOptions(genericclioptions.IOStreams{Out: buf, ErrOut: errBuf})
|
||||
src := fileSpec{
|
||||
File: srcFile,
|
||||
}
|
||||
@@ -562,8 +565,9 @@ func TestCopyToPod(t *testing.T) {
|
||||
PodName: "pod-name",
|
||||
File: test.dest,
|
||||
}
|
||||
opts.Complete(tf, cmd)
|
||||
t.Run(name, func(t *testing.T) {
|
||||
err = copyToPod(tf, cmd, buf, errBuf, src, dest)
|
||||
err = opts.copyToPod(src, dest)
|
||||
//If error is NotFound error , it indicates that the
|
||||
//request has been sent correctly.
|
||||
//Treat this as no error.
|
||||
|
Reference in New Issue
Block a user