Skip to content

Commit d6418d8

Browse files
committed
Add error handling for webhook server
1 parent 661c21e commit d6418d8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/operator/app/command.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ func NewOperatorCommand() *cobra.Command {
9999
CertDir: o.AdmissionWebhookCertDir,
100100
}
101101
webhookServer := webhook.NewServer(webhookServerOptions)
102-
mgr.Add(webhookServer)
102+
if err := mgr.Add(webhookServer); err != nil {
103+
setupLog.Error(err, "unable to add admission webhook server to manager")
104+
os.Exit(1)
105+
}
103106
}
104107
if err != nil {
105108
setupLog.Error(err, "unable to start manager")

0 commit comments

Comments
 (0)