diff --git a/pkg/cmd/attach/attach.go b/pkg/cmd/attach/attach.go index 668524ab..e403b520 100644 --- a/pkg/cmd/attach/attach.go +++ b/pkg/cmd/attach/attach.go @@ -17,6 +17,7 @@ limitations under the License. package attach import ( + "context" "fmt" "io" "net/url" @@ -159,7 +160,7 @@ func (*DefaultRemoteAttach) Attach(method string, url *url.URL, config *restclie if err != nil { return err } - return exec.Stream(remotecommand.StreamOptions{ + return exec.StreamWithContext(context.Background(), remotecommand.StreamOptions{ Stdin: stdin, Stdout: stdout, Stderr: stderr, diff --git a/pkg/cmd/exec/exec.go b/pkg/cmd/exec/exec.go index f3be195d..ff7a3750 100644 --- a/pkg/cmd/exec/exec.go +++ b/pkg/cmd/exec/exec.go @@ -122,7 +122,7 @@ func (*DefaultRemoteExecutor) Execute(method string, url *url.URL, config *restc if err != nil { return err } - return exec.Stream(remotecommand.StreamOptions{ + return exec.StreamWithContext(context.Background(), remotecommand.StreamOptions{ Stdin: stdin, Stdout: stdout, Stderr: stderr,