Make NodeController recognize deletion tombstones.

pull/6/head
David Oppenheimer 2016-10-13 18:38:15 -07:00
parent 01189549f3
commit cd5779a2b1
1 changed files with 10 additions and 1 deletions

View File

@ -118,7 +118,16 @@ func forcefullyDeleteNode(kubeClient clientset.Interface, nodeName string, force
func (nc *NodeController) maybeDeleteTerminatingPod(obj interface{}) {
pod, ok := obj.(*api.Pod)
if !ok {
return
tombstone, ok := obj.(cache.DeletedFinalStateUnknown)
if !ok {
glog.Errorf("Couldn't get object from tombstone %#v", obj)
return
}
pod, ok = tombstone.Obj.(*api.Pod)
if !ok {
glog.Errorf("Tombstone contained object that is not a Pod %#v", obj)
return
}
}
// consider only terminating pods