mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-02 06:47:34 +00:00
Computing DisruptedPods of PDB in scheduling preemption
This commit is contained in:
@@ -916,9 +916,12 @@ func filterPodsWithPDBViolation(pods []*v1.Pod, pdbs []*policy.PodDisruptionBudg
|
||||
// We have found a matching PDB.
|
||||
if pdbsAllowed[i] <= 0 {
|
||||
pdbForPodIsViolated = true
|
||||
break
|
||||
} else {
|
||||
pdbsAllowed[i]--
|
||||
// Only decrement the matched pdb when it's not in its <DisruptedPods>;
|
||||
// otherwise we may over-decrement the budget number.
|
||||
if _, exist := pdb.Status.DisruptedPods[pod.Name]; !exist {
|
||||
pdbsAllowed[i]--
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user