@@ -378,29 +378,29 @@ func TestDefaultScheme(t *testing.T) {
378
378
//}
379
379
380
380
func TestSnapshotterFromPodSandboxConfig (t * testing.T ) {
381
- defaultSnashotter := "native"
381
+ defaultSnapshotter := "native"
382
382
runtimeSnapshotter := "devmapper"
383
383
tests := []struct {
384
- desc string
385
- podSandboxConfig * runtime.PodSandboxConfig
386
- expectSnapshotter string
387
- expectErr bool
384
+ desc string
385
+ podSandboxConfig * runtime.PodSandboxConfig
386
+ expectedSnapshotter string
387
+ expectedErr bool
388
388
}{
389
389
{
390
- desc : "should return default snapshotter for nil podSandboxConfig" ,
391
- expectSnapshotter : defaultSnashotter ,
390
+ desc : "should return default snapshotter for nil podSandboxConfig" ,
391
+ expectedSnapshotter : defaultSnapshotter ,
392
392
},
393
393
{
394
- desc : "should return default snapshotter for nil podSandboxConfig.Annotations" ,
395
- podSandboxConfig : & runtime.PodSandboxConfig {},
396
- expectSnapshotter : defaultSnashotter ,
394
+ desc : "should return default snapshotter for nil podSandboxConfig.Annotations" ,
395
+ podSandboxConfig : & runtime.PodSandboxConfig {},
396
+ expectedSnapshotter : defaultSnapshotter ,
397
397
},
398
398
{
399
399
desc : "should return default snapshotter for empty podSandboxConfig.Annotations" ,
400
400
podSandboxConfig : & runtime.PodSandboxConfig {
401
401
Annotations : make (map [string ]string ),
402
402
},
403
- expectSnapshotter : defaultSnashotter ,
403
+ expectedSnapshotter : defaultSnapshotter ,
404
404
},
405
405
{
406
406
desc : "should return default snapshotter for runtime not found" ,
@@ -409,30 +409,30 @@ func TestSnapshotterFromPodSandboxConfig(t *testing.T) {
409
409
annotations .RuntimeHandler : "runtime-not-exists" ,
410
410
},
411
411
},
412
- expectSnapshotter : defaultSnashotter ,
412
+ expectedSnapshotter : defaultSnapshotter ,
413
413
},
414
414
{
415
415
desc : "should return snapshotter provided in podSandboxConfig.Annotations" ,
416
416
podSandboxConfig : & runtime.PodSandboxConfig {
417
417
Annotations : map [string ]string {
418
- annotations .RuntimeHandler : "exiting -runtime" ,
418
+ annotations .RuntimeHandler : "existing -runtime" ,
419
419
},
420
420
},
421
- expectSnapshotter : runtimeSnapshotter ,
421
+ expectedSnapshotter : runtimeSnapshotter ,
422
422
},
423
423
}
424
424
425
425
for _ , tt := range tests {
426
426
t .Run (tt .desc , func (t * testing.T ) {
427
427
cri , _ := newTestCRIService ()
428
- cri .config .Snapshotter = defaultSnashotter
429
- cri .runtimePlatforms ["exiting -runtime" ] = ImagePlatform {
428
+ cri .config .Snapshotter = defaultSnapshotter
429
+ cri .runtimePlatforms ["existing -runtime" ] = ImagePlatform {
430
430
Platform : platforms .DefaultSpec (),
431
431
Snapshotter : runtimeSnapshotter ,
432
432
}
433
433
snapshotter , err := cri .snapshotterFromPodSandboxConfig (context .Background (), "test-image" , tt .podSandboxConfig )
434
- assert .Equal (t , tt .expectSnapshotter , snapshotter )
435
- if tt .expectErr {
434
+ assert .Equal (t , tt .expectedSnapshotter , snapshotter )
435
+ if tt .expectedErr {
436
436
assert .Error (t , err )
437
437
}
438
438
})
0 commit comments