mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-01 01:08:55 +00:00
code cleanup: scheduler simplify the check function in NodeLabel.Filter
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user