mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Merge pull request #53447 from yastij/nodecontroller-clean-backwards-newNodecontroller
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. cleaning newNodeController from unsupported kubelet version **What this PR does / why we need it**: this part of the #52356 effort **Which issue this PR fixes** : fixes # **Special notes for your reviewer**: **Release note**: ```release-note None ```
This commit is contained in:
commit
be606bc5a7
@ -186,7 +186,6 @@ type Controller struct {
|
|||||||
cidrAllocator ipam.CIDRAllocator
|
cidrAllocator ipam.CIDRAllocator
|
||||||
taintManager *scheduler.NoExecuteTaintManager
|
taintManager *scheduler.NoExecuteTaintManager
|
||||||
|
|
||||||
forcefullyDeletePod func(*v1.Pod) error
|
|
||||||
nodeExistsInCloudProvider func(types.NodeName) (bool, error)
|
nodeExistsInCloudProvider func(types.NodeName) (bool, error)
|
||||||
computeZoneStateFunc func(nodeConditions []*v1.NodeCondition) (int, ZoneState)
|
computeZoneStateFunc func(nodeConditions []*v1.NodeCondition) (int, ZoneState)
|
||||||
enterPartialDisruptionFunc func(nodeNum int) float32
|
enterPartialDisruptionFunc func(nodeNum int) float32
|
||||||
@ -285,9 +284,6 @@ func NewNodeController(
|
|||||||
serviceCIDR: serviceCIDR,
|
serviceCIDR: serviceCIDR,
|
||||||
allocateNodeCIDRs: allocateNodeCIDRs,
|
allocateNodeCIDRs: allocateNodeCIDRs,
|
||||||
allocatorType: allocatorType,
|
allocatorType: allocatorType,
|
||||||
forcefullyDeletePod: func(p *v1.Pod) error {
|
|
||||||
return util.ForcefullyDeletePod(kubeClient, p)
|
|
||||||
},
|
|
||||||
nodeExistsInCloudProvider: func(nodeName types.NodeName) (bool, error) {
|
nodeExistsInCloudProvider: func(nodeName types.NodeName) (bool, error) {
|
||||||
return util.NodeExistsInCloudProvider(cloud, nodeName)
|
return util.NodeExistsInCloudProvider(cloud, nodeName)
|
||||||
},
|
},
|
||||||
|
@ -129,17 +129,6 @@ func SetPodTerminationReason(kubeClient clientset.Interface, pod *v1.Pod, nodeNa
|
|||||||
return updatedPod, nil
|
return updatedPod, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ForcefullyDeletePod deletes the pod immediately.
|
|
||||||
func ForcefullyDeletePod(c clientset.Interface, pod *v1.Pod) error {
|
|
||||||
var zero int64
|
|
||||||
glog.Infof("NodeController is force deleting Pod: %v:%v", pod.Namespace, pod.Name)
|
|
||||||
err := c.Core().Pods(pod.Namespace).Delete(pod.Name, &metav1.DeleteOptions{GracePeriodSeconds: &zero})
|
|
||||||
if err == nil {
|
|
||||||
glog.V(4).Infof("forceful deletion of %s succeeded", pod.Name)
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// ForcefullyDeleteNode deletes the node immediately. The pods on the
|
// ForcefullyDeleteNode deletes the node immediately. The pods on the
|
||||||
// node are cleaned up by the podGC.
|
// node are cleaned up by the podGC.
|
||||||
func ForcefullyDeleteNode(kubeClient clientset.Interface, nodeName string) error {
|
func ForcefullyDeleteNode(kubeClient clientset.Interface, nodeName string) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user