Skip to content

Commit cabe677

Browse files
committed
tests: Use EnsureImageExists for image pulling
A previous commit introduced EnsureImageExists, which ensures that a particular image already exists. It also deduplicates the image pulling code. Some tests missed this update. Signed-off-by: Claudiu Belu <[email protected]>
1 parent a78bdf2 commit cabe677

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

integration/container_stats_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ func TestContainerConsumedStats(t *testing.T) {
7575
sb, sbConfig := PodSandboxConfigWithCleanup(t, "sandbox1", "stats")
7676

7777
testImage := GetImage(ResourceConsumer)
78-
img, err := imageService.PullImage(&runtime.ImageSpec{Image: testImage}, nil, sbConfig)
79-
require.NoError(t, err)
80-
defer func() {
81-
assert.NoError(t, imageService.RemoveImage(&runtime.ImageSpec{Image: img}))
82-
}()
78+
EnsureImageExists(t, testImage)
8379

8480
t.Logf("Create a container config and run container in a pod")
8581
containerConfig := ContainerConfig(

0 commit comments

Comments
 (0)