Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update controller-runtime to 0.17.2 #198

Merged
merged 1 commit into from
Mar 26, 2024
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
22 changes: 15 additions & 7 deletions addons/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ import (
addonapiv1alpha1 "open-cluster-management.io/api/addon/v1alpha1"
clusterv1 "open-cluster-management.io/api/cluster/v1"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
)

var (
Expand Down Expand Up @@ -154,12 +156,17 @@ func runHubManager(ctx context.Context, options AddonAgentOptions) {
}

mgr, err := ctrl.NewManager(hubConfig, ctrl.Options{
Scheme: mgrScheme,
Port: 9443,
MetricsBindAddress: "0", // disable metrics
Scheme: mgrScheme,
Metrics: server.Options{
BindAddress: "0", // disable metrics
},
HealthProbeBindAddress: "0", // disable health probe
ReadinessEndpointName: "0", // disable readiness probe
Namespace: options.SpokeClusterName,
Cache: cache.Options{
DefaultNamespaces: map[string]cache.Config{
options.SpokeClusterName: {},
},
},
})
if err != nil {
klog.Error(err, "unable to start manager")
Expand Down Expand Up @@ -207,9 +214,10 @@ func runSpokeManager(ctx context.Context, options AddonAgentOptions) {
}

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: mgrScheme,
Port: 9443,
MetricsBindAddress: "0", // disable metrics
Scheme: mgrScheme,
Metrics: server.Options{
BindAddress: "0", // disable metrics
},
HealthProbeBindAddress: "0", // disable health probe
ReadinessEndpointName: "0", // disable readiness probe
})
Expand Down
8 changes: 5 additions & 3 deletions controllers/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"
)

Expand Down Expand Up @@ -103,9 +104,10 @@ func (o *ManagerOptions) runManager() {
})

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: mgrScheme,
MetricsBindAddress: o.MetricsAddr,
Port: 9443,
Scheme: mgrScheme,
Metrics: server.Options{
BindAddress: o.MetricsAddr,
},
HealthProbeBindAddress: o.ProbeAddr,
LeaderElection: o.EnableLeaderElection,
LeaderElectionID: "1d19c724.odf.openshift.io",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sys v0.16.0 // indirect
Expand Down Expand Up @@ -141,7 +142,6 @@ replace (
sigs.k8s.io/cluster-api-provider-aws => github.com/openshift/cluster-api-provider-aws v0.2.1-0.20210121023454-5ffc5f422a80
sigs.k8s.io/cluster-api-provider-azure => github.com/openshift/cluster-api-provider-azure v0.1.0-alpha.3.0.20210626224711-5d94c794092f
sigs.k8s.io/cluster-api-provider-openstack => github.com/openshift/cluster-api-provider-openstack v0.0.0-20211111204942-611d320170af
sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.15.3
)

exclude (
Expand Down
Loading
Loading