diff --git a/main.go b/main.go index 9ba38851..a4eaab00 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,7 @@ import ( _ "embed" "flag" "fmt" + "log" "os" "sigs.k8s.io/controller-runtime/pkg/webhook" "time" @@ -109,6 +110,15 @@ func main() { opts.BindFlags(flag.CommandLine) flag.Parse() + availableNetworksModes := map[string]struct{}{ + "POOL": {}, + "DHCP": {}, + "MANUAL": {}, + } + if _, ok := availableNetworksModes[defaultNetworkModeForNewVM]; !ok { + log.Fatal("Incorrect default-network-mode-for-new-vm. Can be POOL, DHCP or MANUAL") + } + ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts))) if release.Version == "" { setupLog.Error(fmt.Errorf("release.Version variable should not be empty"), "") @@ -147,10 +157,6 @@ func main() { os.Exit(1) } - if _, ok := os.LookupEnv("USE_K8S_ENV_AS_CONTROL_PLANE_IP"); ok { - useKubernetesHostEnvAsControlPlaneHost = true - } - if err = (&controllers.VCDClusterReconciler{ Client: mgr.GetClient(), Scheme: mgr.GetScheme(),