mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #101317 from BinacsLee/binacs-scheduler-fwk-plugins-nodelabel-cleanup
code cleanup: scheduler simplify the check function in NodeLabel.Filter
This commit is contained in:
commit
eda3faaf44
@ -99,7 +99,7 @@ func (pl *NodeLabel) Filter(ctx context.Context, _ *framework.CycleState, pod *v
|
|||||||
check := func(labels []string, presence bool) bool {
|
check := func(labels []string, presence bool) bool {
|
||||||
for _, label := range labels {
|
for _, label := range labels {
|
||||||
exists := nodeLabels.Has(label)
|
exists := nodeLabels.Has(label)
|
||||||
if (exists && !presence) || (!exists && presence) {
|
if exists != presence {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user