-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): console,vnc reconnect (#553)
* feat(api): console,vnc reconnect Signed-off-by: Daniil Antoshin <[email protected]>
- Loading branch information
Showing
3 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
images/virt-artifact/patches/025-stream-graceful-shutdown.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git a/pkg/virt-handler/rest/console.go b/pkg/virt-handler/rest/console.go | ||
index 4eb681018d..f76f6187a7 100644 | ||
--- a/pkg/virt-handler/rest/console.go | ||
+++ b/pkg/virt-handler/rest/console.go | ||
@@ -43,6 +43,8 @@ import ( | ||
|
||
"kubevirt.io/kubevirt/pkg/util" | ||
"kubevirt.io/kubevirt/pkg/virt-handler/isolation" | ||
+ | ||
+ "github.com/gorilla/websocket" | ||
) | ||
|
||
//const failedRetrieveVMI = "Failed to retrieve VMI" | ||
@@ -326,7 +328,7 @@ func (t *ConsoleHandler) stream(vmi *v1.VirtualMachineInstance, request *restful | ||
|
||
select { | ||
case <-stopCh: | ||
- break | ||
+ clientSocket.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseGoingAway, "close by another connection")) | ||
case err := <-errCh: | ||
if err != nil && err != io.EOF { | ||
log.Log.Object(vmi).Reason(err).Error("Error in proxing websocket and unix socket") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters