Skip to content

Commit 4bae358

Browse files
authored
Replace to use TypedRateLimiter (#331)
Signed-off-by: Jian Qiu <[email protected]>
1 parent 2661ccc commit 4bae358

File tree

29 files changed

+183
-68
lines changed

29 files changed

+183
-68
lines changed

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/mochi-mqtt/server/v2 v2.6.5
99
github.com/onsi/ginkgo v1.16.5
1010
github.com/onsi/gomega v1.36.1
11-
github.com/openshift/build-machinery-go v0.0.0-20240419090851-af9c868bcf52
11+
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee
1212
github.com/spf13/cobra v1.9.1
1313
github.com/spf13/pflag v1.0.6
1414
github.com/stretchr/testify v1.10.0
@@ -21,9 +21,9 @@ require (
2121
k8s.io/client-go v0.33.2
2222
k8s.io/component-base v0.33.2
2323
k8s.io/klog/v2 v2.130.1
24-
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
24+
k8s.io/utils v0.0.0-20241210054802-24370beab758
2525
open-cluster-management.io/api v1.0.0
26-
open-cluster-management.io/sdk-go v1.0.1-0.20250702112448-f9c049f2a96d
26+
open-cluster-management.io/sdk-go v1.0.1-0.20250811075710-18b20e146feb
2727
sigs.k8s.io/controller-runtime v0.20.2
2828
)
2929

@@ -137,7 +137,7 @@ require (
137137
k8s.io/kms v0.33.2 // indirect
138138
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
139139
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect
140-
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
140+
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
141141
sigs.k8s.io/randfill v1.0.0 // indirect
142142
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
143143
sigs.k8s.io/yaml v1.4.0 // indirect

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJw
226226
github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=
227227
github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w=
228228
github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg=
229-
github.com/openshift/build-machinery-go v0.0.0-20240419090851-af9c868bcf52 h1:bqBwrXG7sbJUqP1Og1bR8FvVh7qb7CrMgy9saKmOZFs=
230-
github.com/openshift/build-machinery-go v0.0.0-20240419090851-af9c868bcf52/go.mod h1:b1BuldmJlbA/xYtdZvKi+7j5YGB44qJUJDZ9zwiNCfE=
229+
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee h1:+Sp5GGnjHDhT/a/nQ1xdp43UscBMr7G5wxsYotyhzJ4=
230+
github.com/openshift/build-machinery-go v0.0.0-20250530140348-dc5b2804eeee/go.mod h1:8jcm8UPtg2mCAsxfqKil1xrmRMI3a+XU2TZ9fF8A7TE=
231231
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
232232
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
233233
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -446,18 +446,18 @@ k8s.io/kms v0.33.2 h1:GFwNXX4CZGQCg9DPOaJi1/+iKidCtB9/OIAGdzRo8FI=
446446
k8s.io/kms v0.33.2/go.mod h1:C1I8mjFFBNzfUZXYt9FZVJ8MJl7ynFbGgZFbBzkBJ3E=
447447
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4=
448448
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8=
449-
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=
450-
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
449+
k8s.io/utils v0.0.0-20241210054802-24370beab758 h1:sdbE21q2nlQtFh65saZY+rRM6x6aJJI8IUa1AmH/qa0=
450+
k8s.io/utils v0.0.0-20241210054802-24370beab758/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
451451
open-cluster-management.io/api v1.0.0 h1:54QllH9DTudCk6VrGt0q8CDsE3MghqJeTaTN4RHZpE0=
452452
open-cluster-management.io/api v1.0.0/go.mod h1:/OeqXycNBZQoe3WG6ghuWsMgsKGuMZrK8ZpsU6gWL0Y=
453-
open-cluster-management.io/sdk-go v1.0.1-0.20250702112448-f9c049f2a96d h1:SCFuqIm/ubceCjNFy452ffe8vIZ4N4u4Y5zWNaz0SmM=
454-
open-cluster-management.io/sdk-go v1.0.1-0.20250702112448-f9c049f2a96d/go.mod h1:nc+ySHEg9xgj5cZipnpcc/mQzzGKHoPRVsE1SyqH6YQ=
453+
open-cluster-management.io/sdk-go v1.0.1-0.20250811075710-18b20e146feb h1:voE6JR6Xi8wNTSkhADHP19FpGICUpqt1/lEREQt7TVU=
454+
open-cluster-management.io/sdk-go v1.0.1-0.20250811075710-18b20e146feb/go.mod h1:sHOVhUgA286ceEq3IjFWqxobt9Lu+VBCAUZByFgN0oM=
455455
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM=
456456
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
457457
sigs.k8s.io/controller-runtime v0.20.2 h1:/439OZVxoEc02psi1h4QO3bHzTgu49bb347Xp4gW1pc=
458458
sigs.k8s.io/controller-runtime v0.20.2/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY=
459-
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=
460-
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo=
459+
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
460+
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
461461
sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
462462
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
463463
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=

pkg/addonmanager/addontesting/helpers.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ import (
2121
)
2222

2323
type FakeSyncContext struct {
24-
queue workqueue.RateLimitingInterface
24+
queue workqueue.TypedRateLimitingInterface[string]
2525
recorder events.Recorder
2626
}
2727

2828
func NewFakeSyncContext(t *testing.T) *FakeSyncContext {
2929
return &FakeSyncContext{
30-
queue: workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()),
30+
queue: workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]()),
3131
recorder: NewTestingEventRecorder(t),
3232
}
3333
}
3434

35-
func (f FakeSyncContext) Queue() workqueue.RateLimitingInterface { return f.queue }
36-
func (f FakeSyncContext) Recorder() events.Recorder { return f.recorder }
35+
func (f FakeSyncContext) Queue() workqueue.TypedRateLimitingInterface[string] { return f.queue }
36+
func (f FakeSyncContext) Recorder() events.Recorder { return f.recorder }
3737

3838
func NewUnstructured(apiVersion, kind, namespace, name string) *unstructured.Unstructured {
3939
return &unstructured.Unstructured{

pkg/addonmanager/controllers/addonconfig/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type addonConfigController struct {
3535
addonLister addonlisterv1alpha1.ManagedClusterAddOnLister
3636
addonIndexer cache.Indexer
3737
configListers map[schema.GroupResource]dynamiclister.Lister
38-
queue workqueue.RateLimitingInterface
38+
queue workqueue.TypedRateLimitingInterface[string]
3939
addonFilterFunc factory.EventFilterFunc
4040
configGVRs map[schema.GroupVersionResource]bool
4141
clusterManagementAddonLister addonlisterv1alpha1.ClusterManagementAddOnLister

pkg/addonmanager/controllers/agentdeploy/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ type addonDeployController struct {
4949
managedClusterAddonIndexer cache.Indexer
5050
workIndexer cache.Indexer
5151
agentAddons map[string]agent.AgentAddon
52-
queue workqueue.RateLimitingInterface
52+
queue workqueue.TypedRateLimitingInterface[string]
5353
}
5454

5555
func NewAddonDeployController(

pkg/addonmanager/controllers/cmaconfig/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type cmaConfigController struct {
3636
clusterManagementAddonLister addonlisterv1alpha1.ClusterManagementAddOnLister
3737
clusterManagementAddonIndexer cache.Indexer
3838
configListers map[schema.GroupResource]dynamiclister.Lister
39-
queue workqueue.RateLimitingInterface
39+
queue workqueue.TypedRateLimitingInterface[string]
4040
addonFilterFunc factory.EventFilterFunc
4141
configGVRs map[schema.GroupVersionResource]bool
4242
addonPatcher patcher.Patcher[*addonapiv1alpha1.ClusterManagementAddOn,

vendor/github.com/openshift/build-machinery-go/.ci-operator.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/openshift/build-machinery-go/.gitignore

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/openshift/build-machinery-go/Dockerfile.commitchecker

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/openshift/build-machinery-go/OWNERS

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)