Skip to content

Commit 69977f3

Browse files
committed
Rename machine to machineType
1 parent d6b468f commit 69977f3

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

test/e2e/tests/setup_e2e_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var (
3737
project = flag.String("project", "", "Project to run tests in")
3838
serviceAccount = flag.String("service-account", "", "Service account to bring up instance with")
3939
zones = flag.String("zones", "us-central1-c,us-central1-b", "Zones to run tests in. If there are multiple zones, separate each by comma")
40-
machine = flag.String("machine", "n1-standard-1", "Type of machine to provision instance on")
40+
machineType = flag.String("machine-type", "n1-standard-1", "Type of machine to provision instance on")
4141
imageURL = flag.String("image-url", "projects/debian-cloud/global/images/family/debian-11", "OS image url to get image from")
4242
runInProw = flag.Bool("run-in-prow", false, "If true, use a Boskos loaned project and special CI service accounts and ssh keys")
4343
deleteInstances = flag.Bool("delete-instances", false, "Delete the instances after tests run")
@@ -93,7 +93,7 @@ var _ = BeforeSuite(func() {
9393
nodeID := fmt.Sprintf("gce-pd-csi-e2e-%s", curZone)
9494
klog.Infof("Setting up node %s\n", nodeID)
9595

96-
i, err := remote.SetupInstance(*project, curZone, nodeID, *machine, *serviceAccount, *imageURL, computeService)
96+
i, err := remote.SetupInstance(*project, curZone, nodeID, *machineType, *serviceAccount, *imageURL, computeService)
9797
if err != nil {
9898
klog.Fatalf("Failed to setup instance %v: %v", nodeID, err)
9999
}

test/remote/instance.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ const (
4545
)
4646

4747
type InstanceInfo struct {
48-
project string
49-
zone string
50-
name string
51-
machine string
48+
project string
49+
zone string
50+
name string
51+
machineType string
5252

5353
// External IP is filled in after instance creation
5454
externalIP string
@@ -68,12 +68,12 @@ func (i *InstanceInfo) GetNodeID() string {
6868
return common.CreateNodeID(i.project, i.zone, i.name)
6969
}
7070

71-
func CreateInstanceInfo(project, instanceZone, name, machine string, cs *compute.Service) (*InstanceInfo, error) {
71+
func CreateInstanceInfo(project, instanceZone, name, machineType string, cs *compute.Service) (*InstanceInfo, error) {
7272
return &InstanceInfo{
73-
project: project,
74-
zone: instanceZone,
75-
name: name,
76-
machine: machine,
73+
project: project,
74+
zone: instanceZone,
75+
name: name,
76+
machineType: machineType,
7777

7878
computeService: cs,
7979
}, nil
@@ -94,7 +94,7 @@ func (i *InstanceInfo) CreateOrGetInstance(imageURL, serviceAccount string) erro
9494

9595
inst := &compute.Instance{
9696
Name: i.name,
97-
MachineType: machineType(i.zone, i.machine),
97+
MachineType: machineType(i.zone, i.machineType),
9898
NetworkInterfaces: []*compute.NetworkInterface{
9999
{
100100
AccessConfigs: []*compute.AccessConfig{
@@ -215,8 +215,8 @@ func getTimestamp() string {
215215
return fmt.Sprintf(time.Now().Format(timestampFormat))
216216
}
217217

218-
func machineType(zone, machine string) string {
219-
return fmt.Sprintf("zones/%s/machineTypes/%s", zone, machine)
218+
func machineType(zone, machineType string) string {
219+
return fmt.Sprintf("zones/%s/machineTypes/%s", zone, machineType)
220220
}
221221

222222
// Create default SSH filewall rule if it does not exist

test/remote/setup-teardown.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ type processes struct {
5454
}
5555

5656
// SetupInstance sets up the specified GCE Instance for E2E testing and returns a handle to the instance object for future use.
57-
func SetupInstance(instanceProject, instanceZone, instanceName, instanceMachine, instanceServiceAccount, instanceImageURL string, cs *compute.Service) (*InstanceInfo, error) {
57+
func SetupInstance(instanceProject, instanceZone, instanceName, instanceMachineType, instanceServiceAccount, instanceImageURL string, cs *compute.Service) (*InstanceInfo, error) {
5858
// Create the instance in the requisite zone
59-
instance, err := CreateInstanceInfo(instanceProject, instanceZone, instanceName, instanceMachine, cs)
59+
instance, err := CreateInstanceInfo(instanceProject, instanceZone, instanceName, instanceMachineType, cs)
6060
if err != nil {
6161
return nil, err
6262
}

0 commit comments

Comments
 (0)