Moving deletion behavior from the NC into PodGC
This should be a NOP because we're just moving functionality around and thanks to #35476, the podGC controller should always run anyway.
This commit is contained in:
@@ -135,12 +135,6 @@ func (nc *NodeController) maybeDeleteTerminatingPod(obj interface{}) {
|
||||
return
|
||||
}
|
||||
|
||||
// delete terminating pods that have not yet been scheduled
|
||||
if len(pod.Spec.NodeName) == 0 {
|
||||
utilruntime.HandleError(nc.forcefullyDeletePod(pod))
|
||||
return
|
||||
}
|
||||
|
||||
nodeObj, found, err := nc.nodeStore.Store.GetByKey(pod.Spec.NodeName)
|
||||
if err != nil {
|
||||
// this can only happen if the Store.KeyFunc has a problem creating
|
||||
@@ -150,11 +144,8 @@ func (nc *NodeController) maybeDeleteTerminatingPod(obj interface{}) {
|
||||
return
|
||||
}
|
||||
|
||||
// delete terminating pods that have been scheduled on
|
||||
// nonexistent nodes
|
||||
// if there is no such node, do nothing and let the podGC clean it up.
|
||||
if !found {
|
||||
glog.Warningf("Unable to find Node: %v, deleting all assigned Pods.", pod.Spec.NodeName)
|
||||
utilruntime.HandleError(nc.forcefullyDeletePod(pod))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -1723,14 +1723,14 @@ func TestCheckPod(t *testing.T) {
|
||||
ObjectMeta: api.ObjectMeta{DeletionTimestamp: &unversioned.Time{}},
|
||||
Spec: api.PodSpec{NodeName: ""},
|
||||
},
|
||||
prune: true,
|
||||
prune: false,
|
||||
},
|
||||
{
|
||||
pod: api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{DeletionTimestamp: &unversioned.Time{}},
|
||||
Spec: api.PodSpec{NodeName: "nonexistant"},
|
||||
},
|
||||
prune: true,
|
||||
prune: false,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user