@@ -36,16 +36,19 @@ import (
3636)
3737
3838var (
39- project = flag .String ("project" , "" , "Project to run tests in" )
40- serviceAccount = flag .String ("service-account" , "" , "Service account to bring up instance with" )
41- architecture = flag .String ("arch" , "amd64" , "Architecture pd csi driver build on" )
42- zones = flag .String ("zones" , "us-east4-a,us-east4-c" , "Zones to run tests in. If there are multiple zones, separate each by comma" )
43- machineType = flag .String ("machine-type" , "n2-standard-2" , "Type of machine to provision instance on" )
44- imageURL = flag .String ("image-url" , "projects/debian-cloud/global/images/family/debian-11" , "OS image url to get image from" )
45- runInProw = flag .Bool ("run-in-prow" , false , "If true, use a Boskos loaned project and special CI service accounts and ssh keys" )
46- deleteInstances = flag .Bool ("delete-instances" , false , "Delete the instances after tests run" )
47- cloudtopHost = flag .Bool ("cloudtop-host" , false , "The local host is cloudtop, a kind of googler machine with special requirements to access GCP" )
48- extraDriverFlags = flag .String ("extra-driver-flags" , "" , "Extra flags to pass to the driver" )
39+ project = flag .String ("project" , "" , "Project to run tests in" )
40+ serviceAccount = flag .String ("service-account" , "" , "Service account to bring up instance with" )
41+ vmNamePrefix = flag .String ("vm-name-prefix" , "gce-pd-csi-e2e" , "VM name prefix" )
42+ architecture = flag .String ("arch" , "amd64" , "Architecture pd csi driver build on" )
43+ minCpuPlatform = flag .String ("min-cpu-platform" , "AMD Milan" , "Minimum CPU architecture" )
44+ zones = flag .String ("zones" , "us-east4-a,us-east4-c" , "Zones to run tests in. If there are multiple zones, separate each by comma" )
45+ machineType = flag .String ("machine-type" , "n2d-standard-2" , "Type of machine to provision instance on" )
46+ imageURL = flag .String ("image-url" , "projects/ubuntu-os-cloud/global/images/family/ubuntu-minimal-2310-amd64" , "OS image url to get image from" )
47+ runInProw = flag .Bool ("run-in-prow" , false , "If true, use a Boskos loaned project and special CI service accounts and ssh keys" )
48+ deleteInstances = flag .Bool ("delete-instances" , false , "Delete the instances after tests run" )
49+ cloudtopHost = flag .Bool ("cloudtop-host" , false , "The local host is cloudtop, a kind of googler machine with special requirements to access GCP" )
50+ extraDriverFlags = flag .String ("extra-driver-flags" , "" , "Extra flags to pass to the driver" )
51+ enableConfidentialCompute = flag .Bool ("enable-confidential-compute" , false , "Create VMs with confidential compute mode. This uses NVMe devices" )
4952
5053 testContexts = []* remote.TestContext {}
5154 computeService * compute.Service
@@ -130,21 +133,24 @@ func getDriverConfig() testutils.DriverConfig {
130133 }
131134}
132135
133- func getRemoteInstanceConfig () * remote.InstanceConfig {
134- return & remote.InstanceConfig {
135- Project : * project ,
136- Architecture : * architecture ,
137- MachineType : * machineType ,
138- ServiceAccount : * serviceAccount ,
139- ImageURL : * imageURL ,
140- CloudtopHost : * cloudtopHost }
141- }
142-
143136func NewTestContext (zone string ) * remote.TestContext {
144- nodeID := fmt .Sprintf ("gce-pd-csi-e2e- %s" , zone )
137+ nodeID := fmt .Sprintf ("%s- %s" , * vmNamePrefix , zone )
145138 klog .Infof ("Setting up node %s" , nodeID )
146139
147- i , err := remote .SetupInstance (getRemoteInstanceConfig (), zone , nodeID , computeService )
140+ instanceConfig := remote.InstanceConfig {
141+ Project : * project ,
142+ Architecture : * architecture ,
143+ MinCpuPlatform : * minCpuPlatform ,
144+ Zone : zone ,
145+ Name : nodeID ,
146+ MachineType : * machineType ,
147+ ServiceAccount : * serviceAccount ,
148+ ImageURL : * imageURL ,
149+ CloudtopHost : * cloudtopHost ,
150+ EnableConfidentialCompute : * enableConfidentialCompute ,
151+ ComputeService : computeService ,
152+ }
153+ i , err := remote .SetupInstance (instanceConfig )
148154 if err != nil {
149155 klog .Fatalf ("Failed to setup instance %v: %v" , nodeID , err )
150156 }
0 commit comments