File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import (
32
32
"k8s.io/apimachinery/pkg/types"
33
33
"k8s.io/client-go/kubernetes/scheme"
34
34
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
35
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
35
36
36
37
// +kubebuilder:scaffold:imports
37
38
@@ -95,13 +96,15 @@ var _ = BeforeSuite(func() {
95
96
// start webhook server using Manager
96
97
webhookInstallOptions := & testEnv .WebhookInstallOptions
97
98
mgr , err := ctrl .NewManager (cfg , ctrl.Options {
98
- Scheme : scheme .Scheme ,
99
- Host : webhookInstallOptions .LocalServingHost ,
100
- Port : webhookInstallOptions .LocalServingPort ,
101
- CertDir : webhookInstallOptions .LocalServingCertDir ,
99
+ Scheme : scheme .Scheme ,
100
+ WebhookServer : webhook .NewServer (webhook.Options {
101
+ Port : webhookInstallOptions .LocalServingPort ,
102
+ Host : webhookInstallOptions .LocalServingHost ,
103
+ CertDir : webhookInstallOptions .LocalServingCertDir ,
104
+ }),
102
105
LeaderElection : false ,
103
106
Metrics : metricsserver.Options {
104
- BindAddress : 0 ,
107
+ BindAddress : "0" ,
105
108
},
106
109
})
107
110
Expect (err ).NotTo (HaveOccurred ())
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import (
30
30
ctrl "sigs.k8s.io/controller-runtime"
31
31
"sigs.k8s.io/controller-runtime/pkg/healthz"
32
32
"sigs.k8s.io/controller-runtime/pkg/log/zap"
33
+ metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
33
34
34
35
ipamv1alpha1 "github.com/onmetal/ipam/api/v1alpha1"
35
36
"github.com/onmetal/ipam/controllers"
@@ -66,9 +67,10 @@ func main() {
66
67
ctrl .SetLogger (zap .New (zap .UseFlagOptions (& opts )))
67
68
68
69
mgr , err := ctrl .NewManager (ctrl .GetConfigOrDie (), ctrl.Options {
69
- Scheme : scheme ,
70
- MetricsBindAddress : metricsAddr ,
71
- Port : 9443 ,
70
+ Scheme : scheme ,
71
+ Metrics : metricsserver.Options {
72
+ BindAddress : metricsAddr ,
73
+ },
72
74
HealthProbeBindAddress : probeAddr ,
73
75
LeaderElection : enableLeaderElection ,
74
76
LeaderElectionID : "f42c18d5.onmetal.de" ,
You can’t perform that action at this time.
0 commit comments