@@ -34,9 +34,9 @@ import (
34
34
clusterv1alpha1 "github.com/karmada-io/karmada/pkg/apis/cluster/v1alpha1"
35
35
workv1alpha2 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha2"
36
36
"github.com/karmada-io/karmada/pkg/features"
37
- "github.com/karmada-io/karmada/pkg/util"
38
37
"github.com/karmada-io/karmada/pkg/util/fedinformer/keys"
39
38
"github.com/karmada-io/karmada/pkg/util/helper"
39
+ "github.com/karmada-io/karmada/pkg/util/worker"
40
40
)
41
41
42
42
// TaintManagerName is the controller name that will be used when reporting events and metrics.
@@ -51,8 +51,8 @@ type NoExecuteTaintManager struct {
51
51
ClusterTaintEvictionRetryFrequency time.Duration
52
52
ConcurrentReconciles int
53
53
54
- bindingEvictionWorker util .AsyncWorker
55
- clusterBindingEvictionWorker util .AsyncWorker
54
+ bindingEvictionWorker worker .AsyncWorker
55
+ clusterBindingEvictionWorker worker .AsyncWorker
56
56
}
57
57
58
58
// Reconcile performs a full reconciliation for the object referred to by the Request.
@@ -117,27 +117,27 @@ func (tc *NoExecuteTaintManager) syncCluster(ctx context.Context, cluster *clust
117
117
118
118
// Start starts an asynchronous loop that handle evictions.
119
119
func (tc * NoExecuteTaintManager ) Start (ctx context.Context ) error {
120
- bindingEvictionWorkerOptions := util .Options {
120
+ bindingEvictionWorkerOptions := worker .Options {
121
121
Name : "binding-eviction" ,
122
122
KeyFunc : nil ,
123
123
ReconcileFunc : tc .syncBindingEviction ,
124
124
}
125
- tc .bindingEvictionWorker = util .NewAsyncWorker (bindingEvictionWorkerOptions )
125
+ tc .bindingEvictionWorker = worker .NewAsyncWorker (bindingEvictionWorkerOptions )
126
126
tc .bindingEvictionWorker .Run (tc .ConcurrentReconciles , ctx .Done ())
127
127
128
- clusterBindingEvictionWorkerOptions := util .Options {
128
+ clusterBindingEvictionWorkerOptions := worker .Options {
129
129
Name : "cluster-binding-eviction" ,
130
130
KeyFunc : nil ,
131
131
ReconcileFunc : tc .syncClusterBindingEviction ,
132
132
}
133
- tc .clusterBindingEvictionWorker = util .NewAsyncWorker (clusterBindingEvictionWorkerOptions )
133
+ tc .clusterBindingEvictionWorker = worker .NewAsyncWorker (clusterBindingEvictionWorkerOptions )
134
134
tc .clusterBindingEvictionWorker .Run (tc .ConcurrentReconciles , ctx .Done ())
135
135
136
136
<- ctx .Done ()
137
137
return nil
138
138
}
139
139
140
- func (tc * NoExecuteTaintManager ) syncBindingEviction (key util .QueueKey ) error {
140
+ func (tc * NoExecuteTaintManager ) syncBindingEviction (key worker .QueueKey ) error {
141
141
fedKey , ok := key .(keys.FederatedKey )
142
142
if ! ok {
143
143
klog .Errorf ("Failed to sync binding eviction as invalid key: %v" , key )
@@ -193,7 +193,7 @@ func (tc *NoExecuteTaintManager) syncBindingEviction(key util.QueueKey) error {
193
193
return nil
194
194
}
195
195
196
- func (tc * NoExecuteTaintManager ) syncClusterBindingEviction (key util .QueueKey ) error {
196
+ func (tc * NoExecuteTaintManager ) syncClusterBindingEviction (key worker .QueueKey ) error {
197
197
fedKey , ok := key .(keys.FederatedKey )
198
198
if ! ok {
199
199
klog .Errorf ("Failed to sync cluster binding eviction as invalid key: %v" , key )
0 commit comments