Skip to content

Commit 9ee3bfa

Browse files
committed
images: tests: Fix typos in the tests
This is a non-functional change, that fixes the following typos: * Snashotter -> Snapshotter * expectSnapshotter -> expectedSnapshotter * expectErr -> expectedErr * exiting-runtime -> existing-runtime Signed-off-by: Fabiano Fidêncio <[email protected]>
1 parent 17294e5 commit 9ee3bfa

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

internal/cri/server/images/image_pull_test.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -378,29 +378,29 @@ func TestDefaultScheme(t *testing.T) {
378378
//}
379379

380380
func TestSnapshotterFromPodSandboxConfig(t *testing.T) {
381-
defaultSnashotter := "native"
381+
defaultSnapshotter := "native"
382382
runtimeSnapshotter := "devmapper"
383383
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
388388
}{
389389
{
390-
desc: "should return default snapshotter for nil podSandboxConfig",
391-
expectSnapshotter: defaultSnashotter,
390+
desc: "should return default snapshotter for nil podSandboxConfig",
391+
expectedSnapshotter: defaultSnapshotter,
392392
},
393393
{
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,
397397
},
398398
{
399399
desc: "should return default snapshotter for empty podSandboxConfig.Annotations",
400400
podSandboxConfig: &runtime.PodSandboxConfig{
401401
Annotations: make(map[string]string),
402402
},
403-
expectSnapshotter: defaultSnashotter,
403+
expectedSnapshotter: defaultSnapshotter,
404404
},
405405
{
406406
desc: "should return default snapshotter for runtime not found",
@@ -409,30 +409,30 @@ func TestSnapshotterFromPodSandboxConfig(t *testing.T) {
409409
annotations.RuntimeHandler: "runtime-not-exists",
410410
},
411411
},
412-
expectSnapshotter: defaultSnashotter,
412+
expectedSnapshotter: defaultSnapshotter,
413413
},
414414
{
415415
desc: "should return snapshotter provided in podSandboxConfig.Annotations",
416416
podSandboxConfig: &runtime.PodSandboxConfig{
417417
Annotations: map[string]string{
418-
annotations.RuntimeHandler: "exiting-runtime",
418+
annotations.RuntimeHandler: "existing-runtime",
419419
},
420420
},
421-
expectSnapshotter: runtimeSnapshotter,
421+
expectedSnapshotter: runtimeSnapshotter,
422422
},
423423
}
424424

425425
for _, tt := range tests {
426426
t.Run(tt.desc, func(t *testing.T) {
427427
cri, _ := newTestCRIService()
428-
cri.config.Snapshotter = defaultSnashotter
429-
cri.runtimePlatforms["exiting-runtime"] = ImagePlatform{
428+
cri.config.Snapshotter = defaultSnapshotter
429+
cri.runtimePlatforms["existing-runtime"] = ImagePlatform{
430430
Platform: platforms.DefaultSpec(),
431431
Snapshotter: runtimeSnapshotter,
432432
}
433433
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 {
436436
assert.Error(t, err)
437437
}
438438
})

0 commit comments

Comments
 (0)