mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2025-12-23 06:15:47 +00:00
Lint fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
|
||||
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package controllerlib
|
||||
@@ -61,7 +61,7 @@ func New(config Config, opts ...Option) Controller {
|
||||
}
|
||||
|
||||
// set up defaults
|
||||
WithRateLimiter(workqueue.DefaultControllerRateLimiter())(c)
|
||||
WithRateLimiter(workqueue.DefaultTypedControllerRateLimiter[any]())(c)
|
||||
WithRecorder(klogRecorder{})(c)
|
||||
|
||||
for _, opt := range opts {
|
||||
@@ -74,7 +74,7 @@ func New(config Config, opts ...Option) Controller {
|
||||
type controller struct {
|
||||
config Config
|
||||
|
||||
queue workqueue.RateLimitingInterface
|
||||
queue workqueue.TypedRateLimitingInterface[any]
|
||||
queueWrapper Queue
|
||||
maxRetries int
|
||||
recorder events.EventRecorder
|
||||
|
||||
@@ -31,9 +31,12 @@ func WithInitialEvent(key Key) Option {
|
||||
})
|
||||
}
|
||||
|
||||
func WithRateLimiter(limiter workqueue.RateLimiter) Option {
|
||||
func WithRateLimiter(limiter workqueue.TypedRateLimiter[any]) Option {
|
||||
return func(c *controller) {
|
||||
c.queue = workqueue.NewNamedRateLimitingQueue(limiter, c.Name())
|
||||
cfg := workqueue.TypedRateLimitingQueueConfig[any]{
|
||||
Name: c.Name(),
|
||||
}
|
||||
c.queue = workqueue.NewTypedRateLimitingQueueWithConfig(limiter, cfg)
|
||||
c.queueWrapper = &queueWrapper{queue: c.queue}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
||||
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package controllerlib
|
||||
@@ -23,7 +23,7 @@ type Queue interface {
|
||||
var _ Queue = &queueWrapper{}
|
||||
|
||||
type queueWrapper struct {
|
||||
queue workqueue.RateLimitingInterface
|
||||
queue workqueue.TypedRateLimitingInterface[any]
|
||||
}
|
||||
|
||||
func (q *queueWrapper) Add(key Key) {
|
||||
|
||||
Reference in New Issue
Block a user