Skip to content

Commit f7928e7

Browse files
committed
fix lint
Signed-off-by: whosefriendA <[email protected]>
1 parent b0456ae commit f7928e7

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

pkg/controllers/cluster/dynamic_rate_limiter.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func NewDynamicRateLimiter[T comparable](informerManager genericmanager.SingleCl
5757

5858
// When determines how long to wait before processing an item.
5959
// Returns a longer delay when the system is unhealthy.
60-
func (d *DynamicRateLimiter[T]) When(item T) time.Duration {
60+
func (d *DynamicRateLimiter[T]) When(_ T) time.Duration {
6161
currentRate := d.getCurrentRate()
6262
if currentRate == 0 {
6363
return maxEvictionDelay
@@ -122,12 +122,12 @@ func (d *DynamicRateLimiter[T]) getCurrentRate() float32 {
122122
}
123123

124124
// Forget is a no-op as this rate limiter doesn't track individual items.
125-
func (d *DynamicRateLimiter[T]) Forget(item T) {
125+
func (d *DynamicRateLimiter[T]) Forget(_ T) {
126126
// No-op
127127
}
128128

129129
// NumRequeues always returns 0 as this rate limiter doesn't track retries.
130-
func (d *DynamicRateLimiter[T]) NumRequeues(item T) int {
130+
func (d *DynamicRateLimiter[T]) NumRequeues(_ T) int {
131131
return 0
132132
}
133133

@@ -138,7 +138,6 @@ func NewGracefulEvictionRateLimiter[T comparable](
138138
informerManager genericmanager.SingleClusterInformerManager,
139139
evictionOpts config.EvictionQueueOptions,
140140
rateLimiterOpts ratelimiterflag.Options) workqueue.TypedRateLimiter[T] {
141-
142141
dynamicLimiter := NewDynamicRateLimiter[T](informerManager, evictionOpts)
143142
defaultLimiter := ratelimiterflag.DefaultControllerRateLimiter[T](rateLimiterOpts)
144143
return workqueue.NewTypedMaxOfRateLimiter[T](dynamicLimiter, defaultLimiter)

pkg/controllers/cluster/eviction_worker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func NewEvictionWorker(opts EvictionWorkerOptions) EvictionWorker {
8282
keyFunc: opts.KeyFunc,
8383
reconcileFunc: opts.ReconcileFunc,
8484
resourceKindFunc: opts.ResourceKindFunc,
85-
queue: workqueue.NewRateLimitingQueueWithConfig(rateLimiter, workqueue.RateLimitingQueueConfig{
85+
queue: workqueue.NewTypedRateLimitingQueueWithConfig[any](rateLimiter, workqueue.TypedRateLimitingQueueConfig[any]{
8686
Name: opts.Name,
8787
}),
8888
}
@@ -145,7 +145,7 @@ func (w *evictionWorker) worker(ctx context.Context) {
145145

146146
// processNextWorkItem handles a single item from the queue with metrics tracking.
147147
// Returns false when the queue is shutting down, true otherwise.
148-
func (w *evictionWorker) processNextWorkItem(ctx context.Context) bool {
148+
func (w *evictionWorker) processNextWorkItem(_ context.Context) bool {
149149
key, quit := w.queue.Get()
150150
if quit {
151151
return false

0 commit comments

Comments
 (0)