mirror of https://github.com/k3s-io/k3s
Make NodeController recognize deletion tombstones.
parent
01189549f3
commit
cd5779a2b1
|
@ -118,8 +118,17 @@ func forcefullyDeleteNode(kubeClient clientset.Interface, nodeName string, force
|
||||||
func (nc *NodeController) maybeDeleteTerminatingPod(obj interface{}) {
|
func (nc *NodeController) maybeDeleteTerminatingPod(obj interface{}) {
|
||||||
pod, ok := obj.(*api.Pod)
|
pod, ok := obj.(*api.Pod)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
tombstone, ok := obj.(cache.DeletedFinalStateUnknown)
|
||||||
|
if !ok {
|
||||||
|
glog.Errorf("Couldn't get object from tombstone %#v", obj)
|
||||||
return
|
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
|
// consider only terminating pods
|
||||||
if pod.DeletionTimestamp == nil {
|
if pod.DeletionTimestamp == nil {
|
||||||
|
|
Loading…
Reference in New Issue