Skip to content

Commit e25ff46

Browse files
author
daihao
committed
fix daemon set rolling update hang
1 parent 6897c68 commit e25ff46

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/controller/daemon/daemon_controller.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,15 @@ func (dsc *DaemonSetsController) updatePod(old, cur interface{}) {
535535
return
536536
}
537537

538+
if curPod.DeletionTimestamp != nil {
539+
// when a pod is deleted gracefully its deletion timestamp is first modified to reflect a grace period,
540+
// and after such time has passed, the kubelet actually deletes it from the store. We receive an update
541+
// for modification of the deletion timestamp and expect an ds to create more replicas asap, not wait
542+
// until the kubelet actually deletes the pod.
543+
dsc.deletePod(curPod)
544+
return
545+
}
546+
538547
curControllerRef := metav1.GetControllerOf(curPod)
539548
oldControllerRef := metav1.GetControllerOf(oldPod)
540549
controllerRefChanged := !reflect.DeepEqual(curControllerRef, oldControllerRef)

0 commit comments

Comments
 (0)