Merge pull request #98200 from wzshiming/fix-node-shutdown-events

Fix kubelet from panic after getting the wrong signal
This commit is contained in:
Kubernetes Prow Robot 2021-01-20 10:38:47 -08:00 committed by GitHub
commit 737858cd7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}