@@ -56,25 +56,29 @@ func installDriver(platform, goPath, pkgDir, stagingImage, stagingVersion, deplo
56
56
}
57
57
}
58
58
59
- // setup service account file for secret creation
60
- tmpSaFile := filepath .Join (generateUniqueTmpDir (), "cloud-sa.json" )
61
- defer removeDir (filepath .Dir (tmpSaFile ))
59
+ var deployEnv []string
60
+ if deployOverlayName != "noauth" {
61
+ // setup service account file for secret creation
62
+ tmpSaFile := filepath .Join (generateUniqueTmpDir (), "cloud-sa.json" )
63
+ defer removeDir (filepath .Dir (tmpSaFile ))
64
+
65
+ // Need to copy it to name the file "cloud-sa.json"
66
+ out , err := exec .Command ("cp" , * saFile , tmpSaFile ).CombinedOutput ()
67
+ if err != nil {
68
+ return fmt .Errorf ("error copying service account key: %s, err: %v" , out , err )
69
+ }
70
+ defer shredFile (tmpSaFile )
62
71
63
- // Need to copy it to name the file "cloud-sa.json"
64
- out , err := exec .Command ("cp" , * saFile , tmpSaFile ).CombinedOutput ()
65
- if err != nil {
66
- return fmt .Errorf ("error copying service account key: %s, err: %v" , out , err )
72
+ deployEnv = append (deployEnv , fmt .Sprintf ("GCE_PD_SA_DIR=%s" , filepath .Dir (tmpSaFile )))
67
73
}
68
- defer shredFile (tmpSaFile )
69
74
70
75
// deploy driver
71
76
deployCmd := exec .Command (filepath .Join (pkgDir , "deploy" , "kubernetes" , "deploy-driver.sh" ), "--skip-sa-check" )
72
- deployCmd . Env = append (os . Environ () ,
77
+ deployEnv = append (deployEnv ,
73
78
fmt .Sprintf ("GOPATH=%s" , goPath ),
74
- fmt .Sprintf ("GCE_PD_SA_DIR=%s" , filepath .Dir (tmpSaFile )),
75
- fmt .Sprintf ("GCE_PD_DRIVER_VERSION=%s" , deployOverlayName ),
76
- )
77
- err = runCommand ("Deploying driver" , deployCmd )
79
+ fmt .Sprintf ("GCE_PD_DRIVER_VERSION=%s" , deployOverlayName ))
80
+ deployCmd .Env = append (os .Environ (), deployEnv ... )
81
+ err := runCommand ("Deploying driver" , deployCmd )
78
82
if err != nil {
79
83
return fmt .Errorf ("failed to deploy driver: %v" , err )
80
84
}
@@ -87,7 +91,7 @@ func installDriver(platform, goPath, pkgDir, stagingImage, stagingVersion, deplo
87
91
klog .Infof ("Waiting 5 minutes for the driver to start on Linux" )
88
92
time .Sleep (5 * time .Minute )
89
93
}
90
- out , err = exec .Command ("kubectl" , "describe" , "pods" , "-n" , driverNamespace ).CombinedOutput ()
94
+ out , err : = exec .Command ("kubectl" , "describe" , "pods" , "-n" , driverNamespace ).CombinedOutput ()
91
95
klog .Infof ("describe pods \n %s" , string (out ))
92
96
93
97
if err != nil {
0 commit comments