kuebctl cp: discard output from test command

we only care about the exit code

see https://github.com/kubernetes/kubernetes/issues/126669
This commit is contained in:
Benjamin Elder 2024-08-14 16:58:02 -07:00 committed by Arda Güçlü
parent d981b19ad3
commit 78ae67a900

View File

@ -18,7 +18,6 @@ package cp
import ( import (
"archive/tar" "archive/tar"
"bytes"
"context" "context"
"errors" "errors"
"fmt" "fmt"
@ -269,8 +268,8 @@ func (o *CopyOptions) checkDestinationIsDir(dest fileSpec) error {
options := &exec.ExecOptions{ options := &exec.ExecOptions{
StreamOptions: exec.StreamOptions{ StreamOptions: exec.StreamOptions{
IOStreams: genericiooptions.IOStreams{ IOStreams: genericiooptions.IOStreams{
Out: bytes.NewBuffer([]byte{}), Out: io.Discard,
ErrOut: bytes.NewBuffer([]byte{}), ErrOut: io.Discard,
}, },
Namespace: dest.PodNamespace, Namespace: dest.PodNamespace,