@@ -39,7 +39,7 @@ import (
39
39
crdv1 "github.com/kubernetes-csi/external-snapshotter/pkg/apis/volumesnapshot/v1alpha1"
40
40
"github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned/fake"
41
41
"google.golang.org/grpc"
42
- v1 "k8s.io/api/core/v1"
42
+ "k8s.io/api/core/v1"
43
43
storagev1 "k8s.io/api/storage/v1"
44
44
storagev1beta1 "k8s.io/api/storage/v1beta1"
45
45
"k8s.io/apimachinery/pkg/api/resource"
@@ -401,7 +401,7 @@ func TestCreateDriverReturnsInvalidCapacityDuringProvision(t *testing.T) {
401
401
402
402
pluginCaps , controllerCaps := provisionCapabilities ()
403
403
csiProvisioner := NewCSIProvisioner (nil , 5 * time .Second , "test-provisioner" , "test" ,
404
- 5 , csiConn .conn , nil , driverName , pluginCaps , controllerCaps , "" , false , csitrans .New ())
404
+ 5 , csiConn .conn , nil , driverName , pluginCaps , controllerCaps , "" , false , csitrans .New (), nil )
405
405
406
406
// Requested PVC with requestedBytes storage
407
407
deletePolicy := v1 .PersistentVolumeReclaimDelete
@@ -1464,7 +1464,7 @@ func runProvisionTest(t *testing.T, k string, tc provisioningTestcase, requested
1464
1464
1465
1465
pluginCaps , controllerCaps := provisionCapabilities ()
1466
1466
csiProvisioner := NewCSIProvisioner (clientSet , 5 * time .Second , "test-provisioner" , "test" , 5 , csiConn .conn ,
1467
- nil , provisionDriverName , pluginCaps , controllerCaps , supportsMigrationFromInTreePluginName , false , csitrans .New ())
1467
+ nil , provisionDriverName , pluginCaps , controllerCaps , supportsMigrationFromInTreePluginName , false , csitrans .New (), nil )
1468
1468
1469
1469
out := & csi.CreateVolumeResponse {
1470
1470
Volume : & csi.Volume {
@@ -2031,7 +2031,7 @@ func TestProvisionFromSnapshot(t *testing.T) {
2031
2031
2032
2032
pluginCaps , controllerCaps := provisionFromSnapshotCapabilities ()
2033
2033
csiProvisioner := NewCSIProvisioner (clientSet , 5 * time .Second , "test-provisioner" , "test" , 5 , csiConn .conn ,
2034
- client , driverName , pluginCaps , controllerCaps , "" , false , csitrans .New ())
2034
+ client , driverName , pluginCaps , controllerCaps , "" , false , csitrans .New (), nil )
2035
2035
2036
2036
out := & csi.CreateVolumeResponse {
2037
2037
Volume : & csi.Volume {
@@ -2186,7 +2186,7 @@ func TestProvisionWithTopologyEnabled(t *testing.T) {
2186
2186
}
2187
2187
2188
2188
nodes := buildNodes (tc .nodeLabels , k8sTopologyBetaVersion .String ())
2189
- nodeInfos := buildNodeInfos (tc .topologyKeys )
2189
+ csiNodes := buildCSINodes (tc .topologyKeys )
2190
2190
2191
2191
var (
2192
2192
pluginCaps connection.PluginCapabilitySet
@@ -2199,9 +2199,13 @@ func TestProvisionWithTopologyEnabled(t *testing.T) {
2199
2199
pluginCaps , controllerCaps = provisionCapabilities ()
2200
2200
}
2201
2201
2202
- clientSet := fakeclientset .NewSimpleClientset (nodes , nodeInfos )
2202
+ clientSet := fakeclientset .NewSimpleClientset (nodes , csiNodes )
2203
+
2204
+ csiNodeLister , stopChan := csiNodeLister (clientSet , t )
2205
+ defer close (stopChan )
2206
+
2203
2207
csiProvisioner := NewCSIProvisioner (clientSet , 5 * time .Second , "test-provisioner" , "test" , 5 ,
2204
- csiConn .conn , nil , driverName , pluginCaps , controllerCaps , "" , false , csitrans .New ())
2208
+ csiConn .conn , nil , driverName , pluginCaps , controllerCaps , "" , false , csitrans .New (), csiNodeLister )
2205
2209
2206
2210
pv , err := csiProvisioner .Provision (controller.ProvisionOptions {
2207
2211
StorageClass : & storagev1.StorageClass {},
@@ -2256,7 +2260,7 @@ func TestProvisionWithTopologyDisabled(t *testing.T) {
2256
2260
clientSet := fakeclientset .NewSimpleClientset ()
2257
2261
pluginCaps , controllerCaps := provisionWithTopologyCapabilities ()
2258
2262
csiProvisioner := NewCSIProvisioner (clientSet , 5 * time .Second , "test-provisioner" , "test" , 5 ,
2259
- csiConn .conn , nil , driverName , pluginCaps , controllerCaps , "" , false , csitrans .New ())
2263
+ csiConn .conn , nil , driverName , pluginCaps , controllerCaps , "" , false , csitrans .New (), nil )
2260
2264
2261
2265
out := & csi.CreateVolumeResponse {
2262
2266
Volume : & csi.Volume {
@@ -2436,7 +2440,7 @@ func runDeleteTest(t *testing.T, k string, tc deleteTestcase) {
2436
2440
2437
2441
pluginCaps , controllerCaps := provisionCapabilities ()
2438
2442
csiProvisioner := NewCSIProvisioner (clientSet , 5 * time .Second , "test-provisioner" , "test" , 5 ,
2439
- csiConn .conn , nil , driverName , pluginCaps , controllerCaps , "" , false , csitrans .New ())
2443
+ csiConn .conn , nil , driverName , pluginCaps , controllerCaps , "" , false , csitrans .New (), nil )
2440
2444
2441
2445
err = csiProvisioner .Delete (tc .persistentVolume )
2442
2446
if tc .expectErr && err == nil {
@@ -3092,7 +3096,7 @@ func TestProvisionFromPVC(t *testing.T) {
3092
3096
}
3093
3097
3094
3098
csiProvisioner := NewCSIProvisioner (clientSet , 5 * time .Second , "test-provisioner" , "test" , 5 , csiConn .conn ,
3095
- nil , driverName , pluginCaps , controllerCaps , "" , false , csitrans .New ())
3099
+ nil , driverName , pluginCaps , controllerCaps , "" , false , csitrans .New (), nil )
3096
3100
3097
3101
pv , err := csiProvisioner .Provision (tc .volOpts )
3098
3102
if tc .expectErr && err == nil {
@@ -3171,7 +3175,7 @@ func TestProvisionWithMigration(t *testing.T) {
3171
3175
pluginCaps , controllerCaps := provisionCapabilities ()
3172
3176
csiProvisioner := NewCSIProvisioner (clientSet , 5 * time .Second , "test-provisioner" ,
3173
3177
"test" , 5 , csiConn .conn , nil , driverName , pluginCaps , controllerCaps ,
3174
- inTreePluginName , false , mockTranslator )
3178
+ inTreePluginName , false , mockTranslator , nil )
3175
3179
3176
3180
// Set up return values (AnyTimes to avoid overfitting on implementation)
3177
3181
@@ -3331,7 +3335,7 @@ func TestDeleteMigration(t *testing.T) {
3331
3335
pluginCaps , controllerCaps := provisionCapabilities ()
3332
3336
csiProvisioner := NewCSIProvisioner (clientSet , 5 * time .Second , "test-provisioner" ,
3333
3337
"test" , 5 , csiConn .conn , nil , driverName , pluginCaps , controllerCaps , "" ,
3334
- false , mockTranslator )
3338
+ false , mockTranslator , nil )
3335
3339
3336
3340
// Set mock return values (AnyTimes to avoid overfitting on implementation details)
3337
3341
mockTranslator .EXPECT ().IsPVMigratable (gomock .Any ()).Return (tc .expectTranslation ).AnyTimes ()
0 commit comments