@@ -235,7 +235,6 @@ func (h *hostpathCSIDriver) PrepareTest(ctx context.Context, f *framework.Framew
235
235
// Create secondary namespace which will be used for creating driver
236
236
driverNamespace := utils .CreateDriverNamespace (ctx , f )
237
237
driverns := driverNamespace .Name
238
- testns := f .Namespace .Name
239
238
240
239
ginkgo .By (fmt .Sprintf ("deploying %s driver" , h .driverInfo .Name ))
241
240
cancelLogging := utils .StartPodLogs (ctx , f , driverNamespace )
@@ -328,7 +327,6 @@ func (h *hostpathCSIDriver) PrepareTest(ctx context.Context, f *framework.Framew
328
327
cleanupFunc := generateDriverCleanupFunc (
329
328
f ,
330
329
h .driverInfo .Name ,
331
- testns ,
332
330
driverns ,
333
331
cancelLogging )
334
332
ginkgo .DeferCleanup (cleanupFunc )
@@ -600,7 +598,6 @@ func (m *mockCSIDriver) PrepareTest(ctx context.Context, f *framework.Framework)
600
598
// Create secondary namespace which will be used for creating driver
601
599
m .driverNamespace = utils .CreateDriverNamespace (ctx , f )
602
600
driverns := m .driverNamespace .Name
603
- testns := f .Namespace .Name
604
601
605
602
if m .embedded {
606
603
ginkgo .By ("deploying csi mock proxy" )
@@ -762,7 +759,6 @@ func (m *mockCSIDriver) PrepareTest(ctx context.Context, f *framework.Framework)
762
759
driverCleanupFunc := generateDriverCleanupFunc (
763
760
f ,
764
761
"mock" ,
765
- testns ,
766
762
driverns ,
767
763
cancelLogging )
768
764
@@ -942,7 +938,6 @@ func (g *gcePDCSIDriver) GetSnapshotClass(ctx context.Context, config *storagefr
942
938
}
943
939
944
940
func (g * gcePDCSIDriver ) PrepareTest (ctx context.Context , f * framework.Framework ) * storageframework.PerTestConfig {
945
- testns := f .Namespace .Name
946
941
cfg := & storageframework.PerTestConfig {
947
942
Driver : g ,
948
943
Prefix : "gcepd" ,
@@ -1000,7 +995,6 @@ func (g *gcePDCSIDriver) PrepareTest(ctx context.Context, f *framework.Framework
1000
995
cleanupFunc := generateDriverCleanupFunc (
1001
996
f ,
1002
997
"gce-pd" ,
1003
- testns ,
1004
998
driverns ,
1005
999
cancelLogging )
1006
1000
ginkgo .DeferCleanup (cleanupFunc )
@@ -1073,17 +1067,12 @@ func tryFunc(f func()) error {
1073
1067
1074
1068
func generateDriverCleanupFunc (
1075
1069
f * framework.Framework ,
1076
- driverName , testns , driverns string ,
1070
+ driverName , driverns string ,
1077
1071
cancelLogging func ()) func (ctx context.Context ) {
1078
1072
1079
1073
// Cleanup CSI driver and namespaces. This function needs to be idempotent and can be
1080
1074
// concurrently called from defer (or AfterEach) and AfterSuite action hooks.
1081
1075
cleanupFunc := func (ctx context.Context ) {
1082
- ginkgo .By (fmt .Sprintf ("deleting the test namespace: %s" , testns ))
1083
- // Delete the primary namespace but it's okay to fail here because this namespace will
1084
- // also be deleted by framework.Aftereach hook
1085
- _ = tryFunc (func () { f .DeleteNamespace (ctx , testns ) })
1086
-
1087
1076
ginkgo .By (fmt .Sprintf ("uninstalling csi %s driver" , driverName ))
1088
1077
_ = tryFunc (cancelLogging )
1089
1078
0 commit comments