@@ -35,6 +35,7 @@ import (
35
35
var (
36
36
project = flag .String ("project" , "" , "Project to run tests in" )
37
37
architecture = flag .String ("arch" , "amd64" , "Architecture pd csi driver build on" )
38
+ vmName = flag .String ("vm-name" , "" , "Name of the VM to run tests on" )
38
39
serviceAccount = flag .String ("service-account" , "" , "Service account to bring up instance with" )
39
40
runInProw = flag .Bool ("run-in-prow" , false , "If true, use a Boskos loaned project and special CI service accounts and ssh keys" )
40
41
deleteInstances = flag .Bool ("delete-instances" , false , "Delete the instances after tests run" )
@@ -87,7 +88,7 @@ var _ = BeforeSuite(func() {
87
88
for _ , zone := range zones {
88
89
go func (curZone string ) {
89
90
defer GinkgoRecover ()
90
- nodeID := fmt . Sprintf ( "gce-pd-csi-e2e-%s" , curZone )
91
+ nodeID := getNodeId ( * vmName , curZone )
91
92
klog .Infof ("Setting up node %s\n " , nodeID )
92
93
93
94
i , err := remote .SetupInstance (* project , * architecture , curZone , nodeID , * serviceAccount , computeService )
@@ -143,3 +144,10 @@ func getRandomTestContext() *remote.TestContext {
143
144
rn := rand .Intn (len (testContexts ))
144
145
return testContexts [rn ]
145
146
}
147
+
148
+ func getNodeId (vmName , curZone string ) string {
149
+ if vmName == "" {
150
+ return fmt .Sprintf ("gce-pd-csi-e2e-%s" , curZone )
151
+ }
152
+ return vmName
153
+ }
0 commit comments