From 8fb2bb55b4e323339a95182bc8bdc87de0767c7d Mon Sep 17 00:00:00 2001 From: kinjelom Date: Fri, 15 Sep 2023 11:33:55 +0200 Subject: [PATCH] new flags missing implementation --- acceptance-tests/config.go | 54 +++++++++++++++++++++----------------- config/global_flags.go | 8 ++++-- config/merger.go | 3 +++ 3 files changed, 39 insertions(+), 26 deletions(-) diff --git a/acceptance-tests/config.go b/acceptance-tests/config.go index 9980e8ef3..40c92c1ba 100644 --- a/acceptance-tests/config.go +++ b/acceptance-tests/config.go @@ -25,18 +25,21 @@ type Config struct { GCPServiceAccountKey string GCPRegion string - VSphereNetwork string - VSphereSubnetCIDR string - VSphereVCenterIP string - VSphereVCenterUser string - VSphereVCenterPassword string - VSphereVCenterDC string - VSphereVCenterCluster string - VSphereVCenterRP string - VSphereVCenterDS string - VSphereVCenterDisks string - VSphereVCenterVMs string - VSphereVCenterTemplates string + VSphereNetwork string + VSphereSubnetCIDR string + VSphereInternalGW string + VSphereJumpboxIP string + VSphereDirectorInternalIP string + VSphereVCenterIP string + VSphereVCenterUser string + VSphereVCenterPassword string + VSphereVCenterDC string + VSphereVCenterCluster string + VSphereVCenterRP string + VSphereVCenterDS string + VSphereVCenterDisks string + VSphereVCenterVMs string + VSphereVCenterTemplates string OpenStackAuthURL string OpenStackAZ string @@ -237,18 +240,21 @@ func loadConfigFromEnvVars() Config { GCPServiceAccountKey: os.Getenv("BBL_GCP_SERVICE_ACCOUNT_KEY"), GCPRegion: os.Getenv("BBL_GCP_REGION"), - VSphereNetwork: os.Getenv("BBL_VSPHERE_NETWORK"), - VSphereSubnetCIDR: os.Getenv("BBL_VSPHERE_SUBNET_CIDR"), - VSphereVCenterIP: os.Getenv("BBL_VSPHERE_VCENTER_IP"), - VSphereVCenterUser: os.Getenv("BBL_VSPHERE_VCENTER_USER"), - VSphereVCenterPassword: os.Getenv("BBL_VSPHERE_VCENTER_PASSWORD"), - VSphereVCenterDC: os.Getenv("BBL_VSPHERE_VCENTER_DC"), - VSphereVCenterCluster: os.Getenv("BBL_VSPHERE_VCENTER_CLUSTER"), - VSphereVCenterRP: os.Getenv("BBL_VSPHERE_VCENTER_RP"), - VSphereVCenterDS: os.Getenv("BBL_VSPHERE_VCENTER_DS"), - VSphereVCenterDisks: os.Getenv("BBL_VSPHERE_VCENTER_DISKS"), - VSphereVCenterVMs: os.Getenv("BBL_VSPHERE_VCENTER_VMS"), - VSphereVCenterTemplates: os.Getenv("BBL_VSPHERE_VCENTER_TEMPLATES"), + VSphereNetwork: os.Getenv("BBL_VSPHERE_NETWORK"), + VSphereSubnetCIDR: os.Getenv("BBL_VSPHERE_SUBNET_CIDR"), + VSphereInternalGW: os.Getenv("BBL_VSPHERE_INTERNAL_GW"), + VSphereJumpboxIP: os.Getenv("BBL_VSPHERE_JUMPBOX_IP"), + VSphereDirectorInternalIP: os.Getenv("BBL_VSPHERE_DIRECTOR_INTERNAL_IP"), + VSphereVCenterIP: os.Getenv("BBL_VSPHERE_VCENTER_IP"), + VSphereVCenterUser: os.Getenv("BBL_VSPHERE_VCENTER_USER"), + VSphereVCenterPassword: os.Getenv("BBL_VSPHERE_VCENTER_PASSWORD"), + VSphereVCenterDC: os.Getenv("BBL_VSPHERE_VCENTER_DC"), + VSphereVCenterCluster: os.Getenv("BBL_VSPHERE_VCENTER_CLUSTER"), + VSphereVCenterRP: os.Getenv("BBL_VSPHERE_VCENTER_RP"), + VSphereVCenterDS: os.Getenv("BBL_VSPHERE_VCENTER_DS"), + VSphereVCenterDisks: os.Getenv("BBL_VSPHERE_VCENTER_DISKS"), + VSphereVCenterVMs: os.Getenv("BBL_VSPHERE_VCENTER_VMS"), + VSphereVCenterTemplates: os.Getenv("BBL_VSPHERE_VCENTER_TEMPLATES"), OpenStackAuthURL: os.Getenv("BBL_OPENSTACK_AUTH_URL"), OpenStackAZ: os.Getenv("BBL_OPENSTACK_AZ"), diff --git a/config/global_flags.go b/config/global_flags.go index 61f6ad509..dfb267492 100644 --- a/config/global_flags.go +++ b/config/global_flags.go @@ -23,8 +23,12 @@ type GlobalFlags struct { GCPServiceAccountKey string `long:"gcp-service-account-key" env:"BBL_GCP_SERVICE_ACCOUNT_KEY"` GCPRegion string `long:"gcp-region" env:"BBL_GCP_REGION"` - VSphereNetwork string `long:"vsphere-network" env:"BBL_VSPHERE_NETWORK"` - VSphereSubnetCIDR string `long:"vsphere-subnet-cidr" env:"BBL_VSPHERE_SUBNET_CIDR"` + VSphereNetwork string `long:"vsphere-network" env:"BBL_VSPHERE_NETWORK"` + VSphereSubnetCIDR string `long:"vsphere-subnet-cidr" env:"BBL_VSPHERE_SUBNET_CIDR"` + VSphereInternalGW string `long:"vsphere-internal-gw" env:"BBL_VSPHERE_INTERNAL_GW"` + VSphereJumpboxIP string `long:"vsphere-jumpbox-ip" env:"BBL_VSPHERE_JUMPBOX_IP"` + VSphereDirectorInternalIP string `long:"vsphere-director-internal-ip" env:"BBL_VSPHERE_DIRECTOR_INTERNAL_IP"` + VSphereVCenterCluster string `long:"vsphere-vcenter-cluster" env:"BBL_VSPHERE_VCENTER_CLUSTER"` VSphereVCenterDC string `long:"vsphere-vcenter-dc" env:"BBL_VSPHERE_VCENTER_DC"` VSphereVCenterDS string `long:"vsphere-vcenter-ds" env:"BBL_VSPHERE_VCENTER_DS"` diff --git a/config/merger.go b/config/merger.go index 1be2c5c88..35c07880d 100644 --- a/config/merger.go +++ b/config/merger.go @@ -89,6 +89,9 @@ func (m Merger) updateVSphereState(globalFlags GlobalFlags, state storage.State) copyFlagToState(globalFlags.VSphereNetwork, &state.VSphere.Network) copyFlagToState(globalFlags.VSphereVCenterDS, &state.VSphere.VCenterDS) copyFlagToState(globalFlags.VSphereSubnetCIDR, &state.VSphere.SubnetCIDR) + copyFlagToState(globalFlags.VSphereInternalGW, &state.VSphere.InternalGW) + copyFlagToState(globalFlags.VSphereJumpboxIP, &state.VSphere.JumpboxIP) + copyFlagToState(globalFlags.VSphereDirectorInternalIP, &state.VSphere.DirectorInternalIP) copyFlagToStateWithDefault(globalFlags.VSphereVCenterDisks, &state.VSphere.VCenterDisks, globalFlags.VSphereNetwork) copyFlagToStateWithDefault(globalFlags.VSphereVCenterTemplates, &state.VSphere.VCenterTemplates, fmt.Sprintf("%s_templates", globalFlags.VSphereNetwork)) copyFlagToStateWithDefault(globalFlags.VSphereVCenterVMs, &state.VSphere.VCenterVMs, fmt.Sprintf("%s_vms", globalFlags.VSphereNetwork))