Skip to content

Commit f9c440f

Browse files
authored
Merge pull request #636 from jingxu97/oct/linuxonlybuild
Build only linux container image for tests on Linux
2 parents d4c82a5 + e7fc3ef commit f9c440f

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

test/k8s-integration/driver.go

+17-7
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,23 @@ func pushImage(pkgDir, stagingImage, stagingVersion, platform string) error {
120120
}
121121
var cmd *exec.Cmd
122122

123-
// build multi-arch image which can work for both Linux and Windows
124-
cmd = exec.Command("make", "-C", pkgDir, "build-and-push-multi-arch",
125-
fmt.Sprintf("GCE_PD_CSI_STAGING_VERSION=%s", stagingVersion),
126-
fmt.Sprintf("GCE_PD_CSI_STAGING_IMAGE=%s", stagingImage))
127-
err = runCommand("Building and Pushing GCP Container for Windows", cmd)
128-
if err != nil {
129-
return fmt.Errorf("failed to run make command for windows: err: %v", err)
123+
if platform == "windows" {
124+
// build multi-arch image which can work for both Linux and Windows
125+
cmd = exec.Command("make", "-C", pkgDir, "build-and-push-multi-arch",
126+
fmt.Sprintf("GCE_PD_CSI_STAGING_VERSION=%s", stagingVersion),
127+
fmt.Sprintf("GCE_PD_CSI_STAGING_IMAGE=%s", stagingImage))
128+
err = runCommand("Building and Pushing GCP Container for Windows", cmd)
129+
if err != nil {
130+
return fmt.Errorf("failed to run make command for windows: err: %v", err)
131+
}
132+
} else {
133+
cmd = exec.Command("make", "-C", pkgDir, "push-container",
134+
fmt.Sprintf("GCE_PD_CSI_STAGING_VERSION=%s", stagingVersion),
135+
fmt.Sprintf("GCE_PD_CSI_STAGING_IMAGE=%s", stagingImage))
136+
err = runCommand("Pushing GCP Container for Linux", cmd)
137+
if err != nil {
138+
return fmt.Errorf("failed to run make command for linux: err: %v", err)
139+
}
130140
}
131141

132142
return nil

0 commit comments

Comments
 (0)