File tree 2 files changed +16
-11
lines changed
2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,11 @@ func dumpDriverLogs() (context.CancelFunc, error) {
169
169
LogPathPrefix : filepath .Join (artifactsDir , "pd-csi-driver" ) + "/" ,
170
170
}
171
171
ctx , cancel := context .WithCancel (context .Background ())
172
- if err = podlogs .CopyAllLogs (ctx , client , driverNamespace , out ); err != nil {
172
+ namespace := driverNamespace
173
+ if * useGKEManagedDriver {
174
+ namespace = managedDriverNamespace
175
+ }
176
+ if err = podlogs .CopyAllLogs (ctx , client , namespace , out ); err != nil {
173
177
return cancel , fmt .Errorf ("failed to start pod logger: %v" , err )
174
178
}
175
179
return cancel , nil
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ const (
74
74
k8sInDockerBuildBinDir = "_output/dockerized/bin/linux/amd64"
75
75
k8sOutOfDockerBuildBinDir = "_output/bin"
76
76
driverNamespace = "gce-pd-csi-driver"
77
+ managedDriverNamespace = "kube-system"
77
78
)
78
79
79
80
func init () {
@@ -357,18 +358,18 @@ func handle() error {
357
358
if err != nil {
358
359
return fmt .Errorf ("failed to install CSI Driver: %v" , err )
359
360
}
361
+ }
360
362
361
- // Dump all driver logs to the test artifacts
362
- cancel , err := dumpDriverLogs ()
363
- if err != nil {
364
- return fmt .Errorf ("failed to start driver logging: %v" , err )
365
- }
366
- defer func () {
367
- if cancel != nil {
368
- cancel ()
369
- }
370
- }()
363
+ // Dump all driver logs to the test artifacts
364
+ cancel , dumpErr := dumpDriverLogs ()
365
+ if dumpErr != nil {
366
+ return fmt .Errorf ("failed to start driver logging: %v" , dumpErr )
371
367
}
368
+ defer func () {
369
+ if cancel != nil {
370
+ cancel ()
371
+ }
372
+ }()
372
373
373
374
// For windows cluster, it has both Windows nodes and Linux nodes. Before triggering the tests, taint Linux nodes
374
375
// with NoSchedule to avoid test pods being scheduled on Linux. Need to do this step after driver is deployed.
You can’t perform that action at this time.
0 commit comments