@@ -31,6 +31,7 @@ import (
31
31
"sigs.k8s.io/controller-runtime/pkg/healthz"
32
32
"sigs.k8s.io/controller-runtime/pkg/log/zap"
33
33
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
34
+ "sigs.k8s.io/controller-runtime/pkg/webhook"
34
35
35
36
"sigs.k8s.io/ibm-powervs-block-csi-driver/adhoc-controllers/controllers"
36
37
//+kubebuilder:scaffold:imports
@@ -51,11 +52,14 @@ func main() {
51
52
var metricsAddr string
52
53
var enableLeaderElection bool
53
54
var probeAddr string
55
+ var webhookPort int
56
+
54
57
flag .StringVar (& metricsAddr , "metrics-bind-address" , ":8081" , "The address the metric endpoint binds to." )
55
58
flag .StringVar (& probeAddr , "health-probe-bind-address" , ":8082" , "The address the probe endpoint binds to." )
56
59
flag .BoolVar (& enableLeaderElection , "leader-elect" , false ,
57
60
"Enable leader election for controller manager. " +
58
61
"Enabling this will ensure there is only one active controller manager." )
62
+ flag .IntVar (& webhookPort , "webhook-server-port" , 9443 , "The port number that the webhook server will serve." )
59
63
opts := zap.Options {
60
64
Development : true ,
61
65
}
@@ -70,6 +74,7 @@ func main() {
70
74
HealthProbeBindAddress : probeAddr ,
71
75
LeaderElection : enableLeaderElection ,
72
76
LeaderElectionID : "15c66b50.my.domain" ,
77
+ WebhookServer : webhook .NewServer (webhook.Options {Port : webhookPort }),
73
78
})
74
79
if err != nil {
75
80
setupLog .Error (err , "unable to start manager" )
0 commit comments