mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 02:34:03 +00:00
Merge pull request #107701 from kinderyj/perf/new-logic-optimiz-for-DetermineVolumeAction
perf:logic-optimiz-for-DetermineVolumeAction
This commit is contained in:
commit
dea5589b1b
@ -188,10 +188,10 @@ func DetermineVolumeAction(pod *v1.Pod, desiredStateOfWorld cache.DesiredStateOf
|
|||||||
if pod == nil || len(pod.Spec.Volumes) <= 0 {
|
if pod == nil || len(pod.Spec.Volumes) <= 0 {
|
||||||
return defaultAction
|
return defaultAction
|
||||||
}
|
}
|
||||||
nodeName := types.NodeName(pod.Spec.NodeName)
|
|
||||||
keepTerminatedPodVolume := desiredStateOfWorld.GetKeepTerminatedPodVolumesForNode(nodeName)
|
|
||||||
|
|
||||||
if util.IsPodTerminated(pod, pod.Status) {
|
if util.IsPodTerminated(pod, pod.Status) {
|
||||||
|
nodeName := types.NodeName(pod.Spec.NodeName)
|
||||||
|
keepTerminatedPodVolume := desiredStateOfWorld.GetKeepTerminatedPodVolumesForNode(nodeName)
|
||||||
// if pod is terminate we let kubelet policy dictate if volume
|
// if pod is terminate we let kubelet policy dictate if volume
|
||||||
// should be detached or not
|
// should be detached or not
|
||||||
return keepTerminatedPodVolume
|
return keepTerminatedPodVolume
|
||||||
|
Loading…
Reference in New Issue
Block a user