Skip to content

Commit 81b9946

Browse files
committed
Put ARCH inline with make command, andd vmName as flag
1 parent 83b5c98 commit 81b9946

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ gce-pd-driver: require-GCE_PD_CSI_STAGING_VERSION
4343
gce-pd-driver-windows: require-GCE_PD_CSI_STAGING_VERSION
4444
ifeq ($(ARCH), amd64)
4545
mkdir -p bin
46-
GOOS=windows go build -mod=vendor -ldflags -X=main.version=$(STAGINGVERSION) -o bin/${DRIVERWINDOWSBINARY} ./cmd/gce-pd-csi-driver/
46+
GOOS=windows GOARCH=$(ARCH) go build -mod=vendor -ldflags -X=main.version=$(STAGINGVERSION) -o bin/${DRIVERWINDOWSBINARY} ./cmd/gce-pd-csi-driver/
47+
else
48+
echo "Warning: gcp-pd-driver-windows only supports ARCH=amd64."
4749
endif
4850

4951
build-container: require-GCE_PD_CSI_STAGING_IMAGE require-GCE_PD_CSI_STAGING_VERSION init-buildx

test/e2e/tests/setup_e2e_test.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ import (
3535

3636
var (
3737
project = flag.String("project", "", "Project to run tests in")
38+
architecture = flag.String("arch", "amd64", "Architecture pd csi driver build on")
39+
vmName = flag.String("vm-name", "", "Name of the VM to run tests on")
3840
serviceAccount = flag.String("service-account", "", "Service account to bring up instance with")
3941
zones = flag.String("zones", "us-central1-c,us-central1-b", "Zones to run tests in. If there are multiple zones, separate each by comma")
4042
machineType = flag.String("machine-type", "n1-standard-1", "Type of machine to provision instance on")
@@ -90,7 +92,7 @@ var _ = BeforeSuite(func() {
9092
for _, zone := range zones {
9193
go func(curZone string) {
9294
defer GinkgoRecover()
93-
nodeID := fmt.Sprintf("gce-pd-csi-e2e-%s", curZone)
95+
nodeID := getNodeId(*vmName, curZone)
9496
klog.Infof("Setting up node %s\n", nodeID)
9597

9698
i, err := remote.SetupInstance(*project, curZone, nodeID, *machineType, *serviceAccount, *imageURL, computeService)
@@ -146,3 +148,10 @@ func getRandomTestContext() *remote.TestContext {
146148
rn := rand.Intn(len(testContexts))
147149
return testContexts[rn]
148150
}
151+
152+
func getNodeId(vmName, curZone string) string {
153+
if vmName == "" {
154+
return fmt.Sprintf("gce-pd-csi-e2e-%s", curZone)
155+
}
156+
return vmName
157+
}

test/remote/archiver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func CreateDriverArchive(archiveName, pkgPath, binPath string) (string, error) {
5555

5656
func setupBinaries(tarDir, pkgPath, binPath string) error {
5757
klog.V(4).Infof("Making binaries and copying to temp dir...")
58-
out, err := exec.Command("make", "-C", pkgPath).CombinedOutput()
58+
out, err := exec.Command("make", "-C", pkgPath, "ARCH="+architecture).CombinedOutput()
5959
if err != nil {
6060
return fmt.Errorf("Failed to make at %s: %v: %v", pkgPath, string(out), err)
6161
}

0 commit comments

Comments
 (0)