Skip to content

Commit cd5779a

Browse files
author
David Oppenheimer
committed
Make NodeController recognize deletion tombstones.
1 parent 0118954 commit cd5779a

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

pkg/controller/node/controller_utils.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,16 @@ func forcefullyDeleteNode(kubeClient clientset.Interface, nodeName string, force
118118
func (nc *NodeController) maybeDeleteTerminatingPod(obj interface{}) {
119119
pod, ok := obj.(*api.Pod)
120120
if !ok {
121-
return
121+
tombstone, ok := obj.(cache.DeletedFinalStateUnknown)
122+
if !ok {
123+
glog.Errorf("Couldn't get object from tombstone %#v", obj)
124+
return
125+
}
126+
pod, ok = tombstone.Obj.(*api.Pod)
127+
if !ok {
128+
glog.Errorf("Tombstone contained object that is not a Pod %#v", obj)
129+
return
130+
}
122131
}
123132

124133
// consider only terminating pods

0 commit comments

Comments
 (0)