@@ -116,30 +116,32 @@ func NewTaggingController(
116
116
return nil , err
117
117
}
118
118
119
- var rateLimiter workqueue.RateLimiter
119
+ var rateLimiter workqueue.TypedRateLimiter [ any ]
120
120
var rateLimitEnabled bool
121
121
if rateLimit > 0.0 && burstLimit > 0 {
122
122
klog .Infof ("Rate limit enabled on controller with rate %f and burst %d." , rateLimit , burstLimit )
123
123
// This is the workqueue.DefaultControllerRateLimiter() but in case where throttling is enabled on the controller,
124
124
// the rate and burst values are set to the provided values.
125
- rateLimiter = workqueue .NewMaxOfRateLimiter (
126
- workqueue .NewItemExponentialFailureRateLimiter (5 * time .Millisecond , 1000 * time .Second ),
127
- & workqueue.BucketRateLimiter {Limiter : rate .NewLimiter (rate .Limit (rateLimit ), burstLimit )},
125
+ rateLimiter = workqueue .NewTypedMaxOfRateLimiter (
126
+ workqueue .NewTypedItemExponentialFailureRateLimiter [ any ] (5 * time .Millisecond , 1000 * time .Second ),
127
+ & workqueue.TypedBucketRateLimiter [ any ] {Limiter : rate .NewLimiter (rate .Limit (rateLimit ), burstLimit )},
128
128
)
129
129
rateLimitEnabled = true
130
130
} else {
131
131
klog .Infof ("Rate limit disabled on controller." )
132
- rateLimiter = workqueue .DefaultControllerRateLimiter ()
132
+ rateLimiter = workqueue .DefaultTypedControllerRateLimiter [ any ] ()
133
133
rateLimitEnabled = false
134
134
}
135
135
136
136
tc := & Controller {
137
- nodeInformer : nodeInformer ,
138
- kubeClient : kubeClient ,
139
- cloud : awsCloud ,
140
- tags : tags ,
141
- resources : resources ,
142
- workqueue : workqueue .NewNamedRateLimitingQueue (rateLimiter , TaggingControllerClientName ),
137
+ nodeInformer : nodeInformer ,
138
+ kubeClient : kubeClient ,
139
+ cloud : awsCloud ,
140
+ tags : tags ,
141
+ resources : resources ,
142
+ workqueue : workqueue .NewTypedRateLimitingQueueWithConfig [any ](rateLimiter , workqueue.TypedRateLimitingQueueConfig [any ]{
143
+ Name : TaggingControllerClientName ,
144
+ }),
143
145
nodesSynced : nodeInformer .Informer ().HasSynced ,
144
146
nodeMonitorPeriod : nodeMonitorPeriod ,
145
147
rateLimitEnabled : rateLimitEnabled ,
0 commit comments