Skip to content

Commit

Permalink
Deckhouse improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
name212 committed Mar 22, 2024
1 parent 6d15dc2 commit c5cf6ca
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
_ "embed"
"flag"
"fmt"
"log"
"os"
"sigs.k8s.io/controller-runtime/pkg/webhook"
"time"
Expand Down Expand Up @@ -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"), "")
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit c5cf6ca

Please sign in to comment.