Skip to content

Commit 30c62d2

Browse files
xuezhaojunclaude
andauthored
Update dependencies to latest stable versions (#247)
- Update github.com/stolostron/cluster-lifecycle-api to latest main branch (v0.0.0-20251028083736-64a17b44b598) - Update open-cluster-management.io/addon-framework to v1.1.1 (latest stable) - Update open-cluster-management.io/api to v1.1.0 (latest stable) - Update open-cluster-management.io/sdk-go to v1.1.0 (latest stable) - Update github.com/openshift/library-go to v0.0.0-20250711143941-47604345e7ea These dependency updates introduced API changes that required code updates: 1. CSRConfigurationsFunc signature now requires ManagedClusterAddOn parameter and returns error - Updated pkg/proxyagent/agent/agent.go (line 95) - Updated test in pkg/proxyagent/agent/agent_test.go (line 422) 2. CSRSignerFunc signature now requires cluster and addon parameters and returns error - Updated CustomSignerWithExpiry function in pkg/proxyagent/agent/agent.go (line 363) - Updated test in pkg/proxyagent/agent/agent_test.go (line 441) 3. NewInMemoryRecorder now requires PassiveClock parameter - Updated pkg/proxyserver/controllers/managedproxyconfiguration_controller.go (line 73) - Added k8s.io/utils/clock import All tests pass and the build succeeds. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: xuezhaojun <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent 03b5176 commit 30c62d2

File tree

224 files changed

+6308
-6915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+6308
-6915
lines changed

go.mod

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ go 1.24.0
55
require (
66
github.com/onsi/ginkgo/v2 v2.22.0
77
github.com/onsi/gomega v1.36.1
8-
github.com/openshift/library-go v0.0.0-20240621150525-4bb4238aef81
8+
github.com/openshift/library-go v0.0.0-20250711143941-47604345e7ea
99
github.com/pkg/errors v0.9.1
10-
github.com/stolostron/cluster-lifecycle-api v0.0.0-20240813023109-42b5c115d0a3 // TODO: @xuezhaojun remove dependency on stolostron.
10+
github.com/stolostron/cluster-lifecycle-api v0.0.0-20251028083736-64a17b44b598 // TODO: @xuezhaojun remove dependency on stolostron.
1111
github.com/stretchr/testify v1.11.1
1212
google.golang.org/grpc v1.72.1
1313
k8s.io/api v0.34.1
1414
k8s.io/apimachinery v0.34.1
1515
k8s.io/client-go v0.34.1
1616
k8s.io/klog/v2 v2.130.1
1717
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
18-
open-cluster-management.io/addon-framework v0.12.0
19-
open-cluster-management.io/api v0.16.0
20-
open-cluster-management.io/sdk-go v0.16.0
18+
open-cluster-management.io/addon-framework v1.1.1
19+
open-cluster-management.io/api v1.1.0
20+
open-cluster-management.io/sdk-go v1.1.0
2121
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2
2222
sigs.k8s.io/controller-runtime v0.22.3
2323
)
@@ -41,7 +41,6 @@ require (
4141
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
4242
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
4343
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
44-
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
4544
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
4645
github.com/fatih/structs v1.1.0 // indirect
4746
github.com/fsnotify/fsnotify v1.9.0 // indirect

go.sum

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg
126126
github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
127127
github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw=
128128
github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
129-
github.com/openshift/library-go v0.0.0-20240621150525-4bb4238aef81 h1:cAo++YCkjrClksMEAPqK9SLMCroqlbGxNTluxeKGIGc=
130-
github.com/openshift/library-go v0.0.0-20240621150525-4bb4238aef81/go.mod h1:PdASVamWinll2BPxiUpXajTwZxV8A1pQbWEsCN1od7I=
129+
github.com/openshift/library-go v0.0.0-20250711143941-47604345e7ea h1:0BNis5UGo5Z7J9GtRY1nw/pt8hWxIZqvfqnqH3eV5cs=
130+
github.com/openshift/library-go v0.0.0-20250711143941-47604345e7ea/go.mod h1:tptKNust9MdRI0p90DoBSPHIrBa9oh+Rok59tF0vT8c=
131131
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
132132
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
133133
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -154,8 +154,8 @@ github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
154154
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
155155
github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
156156
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
157-
github.com/stolostron/cluster-lifecycle-api v0.0.0-20240813023109-42b5c115d0a3 h1:MwhPBArHWlTZ+BDUb+/dRyYgrcfw8dt+MeqjbAPF3XQ=
158-
github.com/stolostron/cluster-lifecycle-api v0.0.0-20240813023109-42b5c115d0a3/go.mod h1:Sflr4YW8MRsymgNLJDcOAv4oyfeiTRyEDR7PRBkg788=
157+
github.com/stolostron/cluster-lifecycle-api v0.0.0-20251028083736-64a17b44b598 h1:UDNOOzJZp7zPVz+nAwV3EQuNjk7GImLHVuS5+zHCiZg=
158+
github.com/stolostron/cluster-lifecycle-api v0.0.0-20251028083736-64a17b44b598/go.mod h1:wLYW3dYaIsz0tHXaMdabXQB0VXr/hHGaiu2q/kQZJBk=
159159
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
160160
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
161161
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
@@ -276,12 +276,12 @@ k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOP
276276
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts=
277277
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y=
278278
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
279-
open-cluster-management.io/addon-framework v0.12.0 h1:5j7mpyk2ij0SLUZkwWk0KkNTWtsid2w7BIHmhm0Ecok=
280-
open-cluster-management.io/addon-framework v0.12.0/go.mod h1:eReMWXrEHqtilwz5wzEpUrWw9Vfz0HJCH9pi3gOTZns=
281-
open-cluster-management.io/api v0.16.0 h1:fToANqblBmWCn8f6JD4uRHFYJVVaN/usp9PeiRhex1s=
282-
open-cluster-management.io/api v0.16.0/go.mod h1:9erZEWEn4bEqh0nIX2wA7f/s3KCuFycQdBrPrRzi0QM=
283-
open-cluster-management.io/sdk-go v0.16.0 h1:Ui1jerkeLaNaJPu47xjOJ3lh+rJQgeJHD25ViQMzAMs=
284-
open-cluster-management.io/sdk-go v0.16.0/go.mod h1:TyOjZC5YxyM5BRNgwTmLuTbHXX6xXqzYBXllrfoVp9w=
279+
open-cluster-management.io/addon-framework v1.1.1 h1:e7g5UMO7aZj3KXnATWKv1UnmTVr5O0GKCeSvoQp/U1o=
280+
open-cluster-management.io/addon-framework v1.1.1/go.mod h1:KPdLM+CfUKgwVuVE9Tyu2nOuD6LgDmx94HOCnJwLIdo=
281+
open-cluster-management.io/api v1.1.0 h1:fu5xst9T/Ya6o41kqdd0zbNiDU+D3nNMTvoRVeF8j+U=
282+
open-cluster-management.io/api v1.1.0/go.mod h1:lEc5Wkc9ON5ym/qAtIqNgrE7NW7IEOCOC611iQMlnKM=
283+
open-cluster-management.io/sdk-go v1.1.0 h1:vYGkoihIVetyVT4ICO7HjoUHsnh6Gf+Da4ZSmWCamhc=
284+
open-cluster-management.io/sdk-go v1.1.0/go.mod h1:DH4EMNDMiousmaj+noHYQxm48T+dbogiAfALhDnrjMg=
285285
sigs.k8s.io/apiserver-network-proxy v0.33.0 h1:ZF4dofO+/aNrLrHTW4+okufWsasL52LvjrxCFX9S3vA=
286286
sigs.k8s.io/apiserver-network-proxy v0.33.0/go.mod h1:6/9k05mMm6FCSCiagIhk9JKo1ZkfNozBljSfOpopPbk=
287287
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM=

pkg/proxyagent/agent/agent.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ func NewAgentAddon(
9292

9393
agentFactory := addonfactory.NewAgentAddonFactory(common.AddonName, FS, "manifests/charts/addon-agent").
9494
WithAgentRegistrationOption(&agent.RegistrationOption{
95-
CSRConfigurations: func(cluster *clusterv1.ManagedCluster) []addonv1alpha1.RegistrationConfig {
96-
return regConfigs
95+
CSRConfigurations: func(cluster *clusterv1.ManagedCluster, addon *addonv1alpha1.ManagedClusterAddOn) ([]addonv1alpha1.RegistrationConfig, error) {
96+
return regConfigs, nil
9797
},
9898
CSRApproveCheck: func(cluster *clusterv1.ManagedCluster, addon *addonv1alpha1.ManagedClusterAddOn, csr *csrv1.CertificateSigningRequest) bool {
9999
return cluster.Spec.HubAcceptsClient
@@ -360,11 +360,11 @@ type serviceToExpose struct {
360360
}
361361

362362
func CustomSignerWithExpiry(customSignerName string, caKey, caData []byte, duration time.Duration) agent.CSRSignerFunc {
363-
return func(csr *csrv1.CertificateSigningRequest) []byte {
363+
return func(cluster *clusterv1.ManagedCluster, addon *addonv1alpha1.ManagedClusterAddOn, csr *csrv1.CertificateSigningRequest) ([]byte, error) {
364364
if csr.Spec.SignerName != customSignerName {
365-
return nil
365+
return nil, nil
366366
}
367-
return utils.DefaultSignerWithExpiry(caKey, caData, duration)(csr)
367+
return utils.DefaultSignerWithExpiry(caKey, caData, duration)(cluster, addon, csr)
368368
}
369369
}
370370

pkg/proxyagent/agent/agent_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ func TestAgentAddonRegistrationOption(t *testing.T) {
419419

420420
options := agentAddOn.GetAgentAddonOptions()
421421

422-
csrConfigs := options.Registration.CSRConfigurations(c.cluster)
422+
csrConfigs, err := options.Registration.CSRConfigurations(c.cluster, nil)
423+
assert.NoError(t, err)
423424
assert.Len(t, csrConfigs, c.expextedCSRConfigs)
424425

425426
csrApprove := options.Registration.CSRApproveCheck(c.cluster, nil, nil)
@@ -437,7 +438,8 @@ func TestAgentAddonRegistrationOption(t *testing.T) {
437438
rolebinding := actions[3].(clienttesting.CreateAction).GetObject().(*rbacv1.RoleBinding)
438439
assert.Equal(t, "cluster-proxy-addon-agent", rolebinding.Name)
439440

440-
cert := options.Registration.CSRSign(newCSR(c.signerName))
441+
cert, err := options.Registration.CSRSign(nil, nil, newCSR(c.signerName))
442+
assert.NoError(t, err)
441443
assert.Equal(t, c.expectedSignedCSR, (len(cert) != 0))
442444
})
443445
}

pkg/proxyserver/controllers/managedproxyconfiguration_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
corev1client "k8s.io/client-go/kubernetes/typed/core/v1"
3535
corev1listers "k8s.io/client-go/listers/core/v1"
3636
"k8s.io/klog/v2"
37+
"k8s.io/utils/clock"
3738
ctrl "sigs.k8s.io/controller-runtime"
3839
"sigs.k8s.io/controller-runtime/pkg/client"
3940
"sigs.k8s.io/controller-runtime/pkg/manager"
@@ -69,7 +70,7 @@ func RegisterClusterManagementAddonReconciler(
6970
SecretGetter: nativeClient.CoreV1(),
7071
ServiceGetter: nativeClient.CoreV1(),
7172
DeploymentGetter: nativeClient.AppsV1(),
72-
EventRecorder: events.NewInMemoryRecorder("ClusterManagementAddonReconciler"),
73+
EventRecorder: events.NewInMemoryRecorder("ClusterManagementAddonReconciler", clock.RealClock{}),
7374
imagePullPolicy: imagePullPolicy,
7475
}
7576
return r.SetupWithManager(mgr)

vendor/github.com/evanphx/json-patch/.gitignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

vendor/github.com/evanphx/json-patch/LICENSE

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)