@@ -42,17 +42,6 @@ func installDriver(platform, goPath, pkgDir, stagingImage, stagingVersion, deplo
4242 if err != nil {
4343 return fmt .Errorf ("failed to edit kustomize: %s, err: %v" , out , err )
4444 }
45- if platform == "windows" {
46- out , err = exec .Command (
47- filepath .Join (pkgDir , "bin" , "kustomize" ),
48- "edit" ,
49- "set" ,
50- "image" ,
51- fmt .Sprintf ("%s-win=%s-win:%s" , pdImagePlaceholder , stagingImage , stagingVersion )).CombinedOutput ()
52- if err != nil {
53- return fmt .Errorf ("failed to edit kustomize: %s, err: %v" , out , err )
54- }
55- }
5645 }
5746
5847 var deployEnv []string
@@ -131,22 +120,15 @@ func pushImage(pkgDir, stagingImage, stagingVersion, platform string) error {
131120 }
132121 var cmd * exec.Cmd
133122
134- cmd = exec .Command ("make" , "-C" , pkgDir , "push-container" ,
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" ,
135125 fmt .Sprintf ("GCE_PD_CSI_STAGING_VERSION=%s" , stagingVersion ),
136126 fmt .Sprintf ("GCE_PD_CSI_STAGING_IMAGE=%s" , stagingImage ))
137- err = runCommand ("Pushing GCP Container for Linux " , cmd )
127+ err = runCommand ("Building and Pushing GCP Container for Windows " , cmd )
138128 if err != nil {
139- return fmt .Errorf ("failed to run make command for linux: err: %v" , err )
140- }
141- if platform == "windows" {
142- cmd = exec .Command ("make" , "-C" , pkgDir , "build-and-push-windows-container-ltsc2019" ,
143- fmt .Sprintf ("GCE_PD_CSI_STAGING_VERSION=%s" , stagingVersion ),
144- fmt .Sprintf ("GCE_PD_CSI_STAGING_IMAGE=%s-win" , stagingImage ))
145- err = runCommand ("Building and Pushing GCP Container for Windows" , cmd )
146- if err != nil {
147- return fmt .Errorf ("failed to run make command for windows: err: %v" , err )
148- }
129+ return fmt .Errorf ("failed to run make command for windows: err: %v" , err )
149130 }
131+
150132 return nil
151133}
152134
0 commit comments