detect ENABLE_WEBHOOKS!=false

This commit is contained in:
Chris Lu 2020-11-03 20:24:19 -08:00
parent 561e7fcc3a
commit ac68889024
1 changed files with 6 additions and 3 deletions

View File

@ -75,9 +75,12 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "Seaweed")
os.Exit(1)
}
if err = (&seaweedv1.Seaweed{}).SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", "Seaweed")
os.Exit(1)
if os.Getenv("ENABLE_WEBHOOKS") != "false" {
if err = (&seaweedv1.Seaweed{}).SetupWebhookWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create webhook", "webhook", "Seaweed")
os.Exit(1)
}
}
// +kubebuilder:scaffold:builder