mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
scheduler: handle error of podSpreadCache.removePod method
This commit is contained in:
parent
d92a250636
commit
20e3580066
@ -398,8 +398,8 @@ func (c *podSpreadCache) addPod(addedPod, preemptorPod *v1.Pod, node *v1.Node) e
|
|||||||
return c.updatePod(addedPod, preemptorPod, node, 1)
|
return c.updatePod(addedPod, preemptorPod, node, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *podSpreadCache) removePod(deletedPod, preemptorPod *v1.Pod, node *v1.Node) {
|
func (c *podSpreadCache) removePod(deletedPod, preemptorPod *v1.Pod, node *v1.Node) error {
|
||||||
c.updatePod(deletedPod, preemptorPod, node, -1)
|
return c.updatePod(deletedPod, preemptorPod, node, -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *podSpreadCache) updatePod(updatedPod, preemptorPod *v1.Pod, node *v1.Node, delta int32) error {
|
func (c *podSpreadCache) updatePod(updatedPod, preemptorPod *v1.Pod, node *v1.Node, delta int32) error {
|
||||||
@ -459,7 +459,9 @@ func (meta *predicateMetadata) RemovePod(deletedPod *v1.Pod, node *v1.Node) erro
|
|||||||
meta.topologyPairsPotentialAffinityPods.removePod(deletedPod)
|
meta.topologyPairsPotentialAffinityPods.removePod(deletedPod)
|
||||||
meta.topologyPairsPotentialAntiAffinityPods.removePod(deletedPod)
|
meta.topologyPairsPotentialAntiAffinityPods.removePod(deletedPod)
|
||||||
// Delete pod from the pod spread topology maps.
|
// Delete pod from the pod spread topology maps.
|
||||||
meta.podSpreadCache.removePod(deletedPod, meta.pod, node)
|
if err := meta.podSpreadCache.removePod(deletedPod, meta.pod, node); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
// All pods in the serviceAffinityMatchingPodList are in the same namespace.
|
// All pods in the serviceAffinityMatchingPodList are in the same namespace.
|
||||||
// So, if the namespace of the first one is not the same as the namespace of the
|
// So, if the namespace of the first one is not the same as the namespace of the
|
||||||
// deletedPod, we don't need to check the list, as deletedPod isn't in the list.
|
// deletedPod, we don't need to check the list, as deletedPod isn't in the list.
|
||||||
|
Loading…
Reference in New Issue
Block a user