@@ -398,8 +398,8 @@ func (c *podSpreadCache) addPod(addedPod, preemptorPod *v1.Pod, node *v1.Node) e
398
398
return c .updatePod (addedPod , preemptorPod , node , 1 )
399
399
}
400
400
401
- func (c * podSpreadCache ) removePod (deletedPod , preemptorPod * v1.Pod , node * v1.Node ) {
402
- c .updatePod (deletedPod , preemptorPod , node , - 1 )
401
+ func (c * podSpreadCache ) removePod (deletedPod , preemptorPod * v1.Pod , node * v1.Node ) error {
402
+ return c .updatePod (deletedPod , preemptorPod , node , - 1 )
403
403
}
404
404
405
405
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
459
459
meta .topologyPairsPotentialAffinityPods .removePod (deletedPod )
460
460
meta .topologyPairsPotentialAntiAffinityPods .removePod (deletedPod )
461
461
// Delete pod from the pod spread topology maps.
462
- meta .podSpreadCache .removePod (deletedPod , meta .pod , node )
462
+ if err := meta .podSpreadCache .removePod (deletedPod , meta .pod , node ); err != nil {
463
+ return err
464
+ }
463
465
// All pods in the serviceAffinityMatchingPodList are in the same namespace.
464
466
// So, if the namespace of the first one is not the same as the namespace of the
465
467
// deletedPod, we don't need to check the list, as deletedPod isn't in the list.
0 commit comments