mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #98200 from wzshiming/fix-node-shutdown-events
Fix kubelet from panic after getting the wrong signal
This commit is contained in:
commit
737858cd7c
@ -142,11 +142,12 @@ func (bus *DBusCon) MonitorShutdown() (<-chan bool, error) {
|
|||||||
case event := <-busChan:
|
case event := <-busChan:
|
||||||
if event == nil || len(event.Body) == 0 {
|
if event == nil || len(event.Body) == 0 {
|
||||||
klog.Errorf("Failed obtaining shutdown event, PrepareForShutdown event was empty")
|
klog.Errorf("Failed obtaining shutdown event, PrepareForShutdown event was empty")
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
shutdownActive, ok := event.Body[0].(bool)
|
shutdownActive, ok := event.Body[0].(bool)
|
||||||
if !ok {
|
if !ok {
|
||||||
klog.Errorf("Failed obtaining shutdown event, PrepareForShutdown event was not bool type as expected")
|
klog.Errorf("Failed obtaining shutdown event, PrepareForShutdown event was not bool type as expected")
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
shutdownChan <- shutdownActive
|
shutdownChan <- shutdownActive
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user