diff --git a/pkg/controller/node/controller_utils.go b/pkg/controller/node/controller_utils.go index 7a708efd606..b54506f695a 100644 --- a/pkg/controller/node/controller_utils.go +++ b/pkg/controller/node/controller_utils.go @@ -57,7 +57,7 @@ func cleanupOrphanedPods(pods []*api.Pod, nodeStore cache.Store, forcefulDeleteP } // deletePods will delete all pods from master running on given node, and return true -// if any pods were deleted. +// if any pods were deleted, or were found pending deletion. func deletePods(kubeClient clientset.Interface, recorder record.EventRecorder, nodeName, nodeUID string, daemonStore cache.StoreToDaemonSetLister) (bool, error) { remaining := false selector := fields.OneTermEqualSelector(api.PodHostField, nodeName) @@ -76,8 +76,9 @@ func deletePods(kubeClient clientset.Interface, recorder record.EventRecorder, n if pod.Spec.NodeName != nodeName { continue } - // if the pod has already been deleted, ignore it + // if the pod has already been marked for deletion, we still return true that there are remaining pods. if pod.DeletionGracePeriodSeconds != nil { + remaining = true continue } // if the pod is managed by a daemonset, ignore it