podtopologyspread: scheduler queueing hints

This commit is contained in:
nayihz
2023-12-04 10:58:19 +08:00
parent 55f2bc1043
commit 09a80df1d1
4 changed files with 463 additions and 21 deletions

View File

@@ -164,3 +164,13 @@ func countPodsMatchSelector(podInfos []*framework.PodInfo, selector labels.Selec
}
return count
}
// podLabelsMatchSpreadConstraints returns whether tha labels matches with the selector in any of topologySpreadConstraint
func podLabelsMatchSpreadConstraints(constraints []topologySpreadConstraint, labels labels.Set) bool {
for _, c := range constraints {
if c.Selector.Matches(labels) {
return true
}
}
return false
}