@@ -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