Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ go 1.24.0
require (
github.com/onsi/ginkgo/v2 v2.22.0
github.com/onsi/gomega v1.36.1
github.com/openshift/library-go v0.0.0-20240621150525-4bb4238aef81
github.com/openshift/library-go v0.0.0-20250711143941-47604345e7ea
github.com/pkg/errors v0.9.1
github.com/stolostron/cluster-lifecycle-api v0.0.0-20240813023109-42b5c115d0a3 // TODO: @xuezhaojun remove dependency on stolostron.
github.com/stolostron/cluster-lifecycle-api v0.0.0-20251028083736-64a17b44b598 // TODO: @xuezhaojun remove dependency on stolostron.
github.com/stretchr/testify v1.11.1
google.golang.org/grpc v1.72.1
k8s.io/api v0.34.1
k8s.io/apimachinery v0.34.1
k8s.io/client-go v0.34.1
k8s.io/klog/v2 v2.130.1
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
open-cluster-management.io/addon-framework v0.12.0
open-cluster-management.io/api v0.16.0
open-cluster-management.io/sdk-go v0.16.0
open-cluster-management.io/addon-framework v1.1.1
open-cluster-management.io/api v1.1.0
open-cluster-management.io/sdk-go v1.1.0
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2
sigs.k8s.io/controller-runtime v0.22.3
)
Expand All @@ -41,7 +41,6 @@ require (
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg
github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw=
github.com/onsi/gomega v1.36.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog=
github.com/openshift/library-go v0.0.0-20240621150525-4bb4238aef81 h1:cAo++YCkjrClksMEAPqK9SLMCroqlbGxNTluxeKGIGc=
github.com/openshift/library-go v0.0.0-20240621150525-4bb4238aef81/go.mod h1:PdASVamWinll2BPxiUpXajTwZxV8A1pQbWEsCN1od7I=
github.com/openshift/library-go v0.0.0-20250711143941-47604345e7ea h1:0BNis5UGo5Z7J9GtRY1nw/pt8hWxIZqvfqnqH3eV5cs=
github.com/openshift/library-go v0.0.0-20250711143941-47604345e7ea/go.mod h1:tptKNust9MdRI0p90DoBSPHIrBa9oh+Rok59tF0vT8c=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand All @@ -154,8 +154,8 @@ github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s=
github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0=
github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stolostron/cluster-lifecycle-api v0.0.0-20240813023109-42b5c115d0a3 h1:MwhPBArHWlTZ+BDUb+/dRyYgrcfw8dt+MeqjbAPF3XQ=
github.com/stolostron/cluster-lifecycle-api v0.0.0-20240813023109-42b5c115d0a3/go.mod h1:Sflr4YW8MRsymgNLJDcOAv4oyfeiTRyEDR7PRBkg788=
github.com/stolostron/cluster-lifecycle-api v0.0.0-20251028083736-64a17b44b598 h1:UDNOOzJZp7zPVz+nAwV3EQuNjk7GImLHVuS5+zHCiZg=
github.com/stolostron/cluster-lifecycle-api v0.0.0-20251028083736-64a17b44b598/go.mod h1:wLYW3dYaIsz0tHXaMdabXQB0VXr/hHGaiu2q/kQZJBk=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
Expand Down Expand Up @@ -276,12 +276,12 @@ k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOP
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts=
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y=
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
open-cluster-management.io/addon-framework v0.12.0 h1:5j7mpyk2ij0SLUZkwWk0KkNTWtsid2w7BIHmhm0Ecok=
open-cluster-management.io/addon-framework v0.12.0/go.mod h1:eReMWXrEHqtilwz5wzEpUrWw9Vfz0HJCH9pi3gOTZns=
open-cluster-management.io/api v0.16.0 h1:fToANqblBmWCn8f6JD4uRHFYJVVaN/usp9PeiRhex1s=
open-cluster-management.io/api v0.16.0/go.mod h1:9erZEWEn4bEqh0nIX2wA7f/s3KCuFycQdBrPrRzi0QM=
open-cluster-management.io/sdk-go v0.16.0 h1:Ui1jerkeLaNaJPu47xjOJ3lh+rJQgeJHD25ViQMzAMs=
open-cluster-management.io/sdk-go v0.16.0/go.mod h1:TyOjZC5YxyM5BRNgwTmLuTbHXX6xXqzYBXllrfoVp9w=
open-cluster-management.io/addon-framework v1.1.1 h1:e7g5UMO7aZj3KXnATWKv1UnmTVr5O0GKCeSvoQp/U1o=
open-cluster-management.io/addon-framework v1.1.1/go.mod h1:KPdLM+CfUKgwVuVE9Tyu2nOuD6LgDmx94HOCnJwLIdo=
open-cluster-management.io/api v1.1.0 h1:fu5xst9T/Ya6o41kqdd0zbNiDU+D3nNMTvoRVeF8j+U=
open-cluster-management.io/api v1.1.0/go.mod h1:lEc5Wkc9ON5ym/qAtIqNgrE7NW7IEOCOC611iQMlnKM=
open-cluster-management.io/sdk-go v1.1.0 h1:vYGkoihIVetyVT4ICO7HjoUHsnh6Gf+Da4ZSmWCamhc=
open-cluster-management.io/sdk-go v1.1.0/go.mod h1:DH4EMNDMiousmaj+noHYQxm48T+dbogiAfALhDnrjMg=
sigs.k8s.io/apiserver-network-proxy v0.33.0 h1:ZF4dofO+/aNrLrHTW4+okufWsasL52LvjrxCFX9S3vA=
sigs.k8s.io/apiserver-network-proxy v0.33.0/go.mod h1:6/9k05mMm6FCSCiagIhk9JKo1ZkfNozBljSfOpopPbk=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM=
Expand Down
10 changes: 5 additions & 5 deletions pkg/proxyagent/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func NewAgentAddon(

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

func CustomSignerWithExpiry(customSignerName string, caKey, caData []byte, duration time.Duration) agent.CSRSignerFunc {
return func(csr *csrv1.CertificateSigningRequest) []byte {
return func(cluster *clusterv1.ManagedCluster, addon *addonv1alpha1.ManagedClusterAddOn, csr *csrv1.CertificateSigningRequest) ([]byte, error) {
if csr.Spec.SignerName != customSignerName {
return nil
return nil, nil
}
return utils.DefaultSignerWithExpiry(caKey, caData, duration)(csr)
return utils.DefaultSignerWithExpiry(caKey, caData, duration)(cluster, addon, csr)
}
}

Expand Down
6 changes: 4 additions & 2 deletions pkg/proxyagent/agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ func TestAgentAddonRegistrationOption(t *testing.T) {

options := agentAddOn.GetAgentAddonOptions()

csrConfigs := options.Registration.CSRConfigurations(c.cluster)
csrConfigs, err := options.Registration.CSRConfigurations(c.cluster, nil)
assert.NoError(t, err)
assert.Len(t, csrConfigs, c.expextedCSRConfigs)

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

cert := options.Registration.CSRSign(newCSR(c.signerName))
cert, err := options.Registration.CSRSign(nil, nil, newCSR(c.signerName))
assert.NoError(t, err)
assert.Equal(t, c.expectedSignedCSR, (len(cert) != 0))
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
corev1client "k8s.io/client-go/kubernetes/typed/core/v1"
corev1listers "k8s.io/client-go/listers/core/v1"
"k8s.io/klog/v2"
"k8s.io/utils/clock"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"
Expand Down Expand Up @@ -69,7 +70,7 @@ func RegisterClusterManagementAddonReconciler(
SecretGetter: nativeClient.CoreV1(),
ServiceGetter: nativeClient.CoreV1(),
DeploymentGetter: nativeClient.AppsV1(),
EventRecorder: events.NewInMemoryRecorder("ClusterManagementAddonReconciler"),
EventRecorder: events.NewInMemoryRecorder("ClusterManagementAddonReconciler", clock.RealClock{}),
imagePullPolicy: imagePullPolicy,
}
return r.SetupWithManager(mgr)
Expand Down
6 changes: 0 additions & 6 deletions vendor/github.com/evanphx/json-patch/.gitignore

This file was deleted.

25 changes: 0 additions & 25 deletions vendor/github.com/evanphx/json-patch/LICENSE

This file was deleted.

Loading