Skip to content

Commit

Permalink
new flags missing implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
kinjelom committed Sep 15, 2023
1 parent 6ea073d commit 849a2b2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 26 deletions.
54 changes: 30 additions & 24 deletions acceptance-tests/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"),
Expand Down
8 changes: 6 additions & 2 deletions config/global_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
3 changes: 3 additions & 0 deletions config/merger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 849a2b2

Please sign in to comment.