fix rolling update stuck caused by deleting terminating pod (#657)

Signed-off-by: 墨封 <mofeng.cj@alibaba-inc.com>
This commit is contained in:
Jie Chen 2021-07-01 19:38:51 +08:00 committed by GitHub
parent 766e68dcc3
commit dee6b813f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -170,6 +170,12 @@ func (dsc *ReconcileDaemonSet) standardRollingUpdate(ds *appsv1alpha1.DaemonSet,
dsc.eventRecorder.Eventf(ds, corev1.EventTypeWarning, "numUnavailable >= maxUnavailable", "%s/%s number of unavailable DaemonSet pods: %d, is equal to or exceeds allowed maximum: %d", ds.Namespace, ds.Name, numUnavailable, maxUnavailable)
break
}
// Skip deleting if there are some pods stuck at terminating but still report as available.
if pod.DeletionTimestamp != nil {
continue
}
klog.V(6).Infof("Marking pod %s/%s for deletion", ds.Name, pod.Name)
oldPodsToDelete = append(oldPodsToDelete, pod.Name)
numUnavailable++