From f28f585c76017cc786d49d8d776b126e5fc36a5e Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 8 Jul 2024 20:34:32 +0300 Subject: [PATCH] Fix panic in stop when the VM goes away Signed-off-by: Oleksandr Redko --- pkg/hostagent/events/watcher.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/hostagent/events/watcher.go b/pkg/hostagent/events/watcher.go index 08072c57d5c..24355dce7f8 100644 --- a/pkg/hostagent/events/watcher.go +++ b/pkg/hostagent/events/watcher.go @@ -44,6 +44,9 @@ loop: case <-ctx.Done(): break loop case line := <-haStdoutTail.Lines: + if line == nil { + break loop + } if line.Err != nil { logrus.Error(line.Err) }