From 0413529b62bedfdf47a5f714466e6c2c68662696 Mon Sep 17 00:00:00 2001 From: wzshiming Date: Tue, 12 Jan 2021 14:33:39 +0800 Subject: [PATCH] Fix dbus shutdown events not continuing if they are not valid --- pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go b/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go index a27bd4e8f70..5b85463b4e8 100644 --- a/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go +++ b/pkg/kubelet/nodeshutdown/systemd/inhibit_linux.go @@ -142,11 +142,12 @@ func (bus *DBusCon) MonitorShutdown() (<-chan bool, error) { case event := <-busChan: if event == nil || len(event.Body) == 0 { klog.Errorf("Failed obtaining shutdown event, PrepareForShutdown event was empty") + continue } shutdownActive, ok := event.Body[0].(bool) if !ok { klog.Errorf("Failed obtaining shutdown event, PrepareForShutdown event was not bool type as expected") - return + continue } shutdownChan <- shutdownActive }