Skip to content

Commit 4a93af2

Browse files
committed
Fix golangci-lint staticcheck errors
SA1019: workqueue.RateLimitingInterface is deprecated: Use TypedRateLimitingInterface instead. (staticcheck) SA1019: workqueue.NewRateLimitingQueueWithConfig is deprecated: Use NewTypedRateLimitingQueueWithConfig instead. (staticcheck) SA1019: workqueue.DefaultControllerRateLimiter is deprecated: Use DefaultTypedControllerRateLimiter instead. (staticcheck) SA1019: workqueue.RateLimitingQueueConfig is deprecated: Use TypedRateLimitingQueueConfig instead. (staticcheck) Signed-off-by: Michael Fritch <[email protected]>
1 parent 3a27742 commit 4a93af2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pkg/controller/pod.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type PodNetworksController struct {
7777
netAttachDefLister nadlisterv1.NetworkAttachmentDefinitionLister
7878
broadcaster record.EventBroadcaster
7979
recorder record.EventRecorder
80-
workqueue workqueue.RateLimitingInterface
80+
workqueue workqueue.TypedRateLimitingInterface[*string]
8181
nadClientSet nadclient.Interface
8282
containerRuntime ContainerRuntime
8383
multusClient multuscni.Client
@@ -106,9 +106,11 @@ func NewPodNetworksController(
106106
netAttachDefLister: nadInformers.K8sCniCncfIo().V1().NetworkAttachmentDefinitions().Lister(),
107107
recorder: recorder,
108108
broadcaster: broadcaster,
109-
workqueue: workqueue.NewRateLimitingQueueWithConfig(
110-
workqueue.DefaultControllerRateLimiter(),
111-
workqueue.RateLimitingQueueConfig{Name: AdvertisedName},
109+
workqueue: workqueue.NewTypedRateLimitingQueueWithConfig[*string](
110+
workqueue.DefaultTypedControllerRateLimiter[*string](),
111+
workqueue.TypedRateLimitingQueueConfig[*string]{
112+
Name: AdvertisedName,
113+
},
112114
),
113115
k8sClientSet: k8sClientSet,
114116
nadClientSet: nadClientSet,
@@ -192,7 +194,7 @@ func (pnc *PodNetworksController) processNextWorkItem() bool {
192194
ctx := context.Background()
193195

194196
defer pnc.workqueue.Done(queueItem)
195-
podNamespacedName := queueItem.(*string)
197+
podNamespacedName := queueItem
196198
klog.Infof("extracted update request for pod [%s] from the queue", *podNamespacedName)
197199
podNamespace, podName, err := separateNamespaceAndName(*podNamespacedName)
198200
if err != nil {

0 commit comments

Comments
 (0)