@@ -20,13 +20,11 @@ import (
20
20
"context"
21
21
"fmt"
22
22
23
- "k8s.io/api/core/v1"
23
+ v1 "k8s.io/api/core/v1"
24
24
"k8s.io/apimachinery/pkg/labels"
25
25
"k8s.io/apimachinery/pkg/runtime"
26
26
corelisters "k8s.io/client-go/listers/core/v1"
27
27
"k8s.io/klog"
28
- "k8s.io/kubernetes/pkg/scheduler/algorithm/predicates"
29
- "k8s.io/kubernetes/pkg/scheduler/framework/plugins/migration"
30
28
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
31
29
schedulerlisters "k8s.io/kubernetes/pkg/scheduler/listers"
32
30
"k8s.io/kubernetes/pkg/scheduler/nodeinfo"
@@ -39,6 +37,9 @@ const (
39
37
// preFilterStateKey is the key in CycleState to InterPodAffinity pre-computed data.
40
38
// Using the name of the plugin will likely help us avoid collisions with other plugins.
41
39
preFilterStateKey = "PreFilter" + Name
40
+
41
+ // ErrServiceAffinityViolated is used for CheckServiceAffinity predicate error.
42
+ ErrServiceAffinityViolated = "node(s) didn't match service affinity"
42
43
)
43
44
44
45
// Args holds the args that are used to configure the plugin.
@@ -276,7 +277,7 @@ func (pl *ServiceAffinity) Filter(ctx context.Context, cycleState *framework.Cyc
276
277
return nil
277
278
}
278
279
279
- return migration . PredicateResultToFrameworkStatus ([]predicates. PredicateFailureReason { predicates . ErrServiceAffinityViolated }, nil )
280
+ return framework . NewStatus ( framework . Unschedulable , ErrServiceAffinityViolated )
280
281
}
281
282
282
283
// Score invoked at the Score extension point.
0 commit comments