Skip to content

Commit 74f2c33

Browse files
committed
Put ARCH inline with make command, andd vmName as flag
1 parent 3d42608 commit 74f2c33

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

Makefile

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

5153
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: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import (
3535
var (
3636
project = flag.String("project", "", "Project to run tests in")
3737
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")
3839
serviceAccount = flag.String("service-account", "", "Service account to bring up instance with")
3940
runInProw = flag.Bool("run-in-prow", false, "If true, use a Boskos loaned project and special CI service accounts and ssh keys")
4041
deleteInstances = flag.Bool("delete-instances", false, "Delete the instances after tests run")
@@ -87,7 +88,7 @@ var _ = BeforeSuite(func() {
8788
for _, zone := range zones {
8889
go func(curZone string) {
8990
defer GinkgoRecover()
90-
nodeID := fmt.Sprintf("gce-pd-csi-e2e-%s", curZone)
91+
nodeID := getNodeId(*vmName, curZone)
9192
klog.Infof("Setting up node %s\n", nodeID)
9293

9394
i, err := remote.SetupInstance(*project, *architecture, curZone, nodeID, *serviceAccount, computeService)
@@ -143,3 +144,10 @@ func getRandomTestContext() *remote.TestContext {
143144
rn := rand.Intn(len(testContexts))
144145
return testContexts[rn]
145146
}
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+
}

test/remote/archiver.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ func CreateDriverArchive(archiveName, architecture, pkgPath, binPath string) (st
5555

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

0 commit comments

Comments
 (0)