Skip to content

Commit

Permalink
Close stream
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac committed Jun 4, 2020
1 parent 1deac6d commit 0bb6325
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/jetstream/plugins/kubernetes/terminal/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,15 @@ func pumpStdout(ws *websocket.Conn, source *websocket.Conn, done chan bool) {
_, r, err := source.ReadMessage()
if err != nil {
// Close
ws.Close()
done <- true
break
}
ws.SetWriteDeadline(time.Now().Add(writeWait))
bytes := fmt.Sprintf("% x\n", r[1:])
if err := ws.WriteMessage(websocket.TextMessage, []byte(bytes)); err != nil {
log.Errorf("Kubernetes Terminal failed to write message: %+v", err)
ws.Close()
break
}
}
Expand Down

0 comments on commit 0bb6325

Please sign in to comment.