diff --git a/staging/src/k8s.io/client-go/tools/remotecommand/websocket.go b/staging/src/k8s.io/client-go/tools/remotecommand/websocket.go index 7e7703ca6b1..cea26a0b557 100644 --- a/staging/src/k8s.io/client-go/tools/remotecommand/websocket.go +++ b/staging/src/k8s.io/client-go/tools/remotecommand/websocket.go @@ -312,7 +312,7 @@ func (c *wsStreamCreator) readDemuxLoop(bufferSize int, period time.Duration, de if errRead == io.EOF { break } - c.closeAllStreamReaders(fmt.Errorf("read message: %w", err)) + c.closeAllStreamReaders(fmt.Errorf("read message: %w", errRead)) return } }