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:
Kubernetes Prow Robot 2021-04-21 08:26:11 -07:00 committed by GitHub
commit eda3faaf44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,7 +99,7 @@ func (pl *NodeLabel) Filter(ctx context.Context, _ *framework.CycleState, pod *v
check := func(labels []string, presence bool) bool {
for _, label := range labels {
exists := nodeLabels.Has(label)
if (exists && !presence) || (!exists && presence) {
if exists != presence {
return false
}
}