From cabe67736941fa4fa1a6fc54b0045891ecc28733 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Tue, 30 Mar 2021 18:26:10 +0300 Subject: [PATCH] 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 --- integration/container_stats_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/integration/container_stats_test.go b/integration/container_stats_test.go index 99c15b2d3..080ccc041 100644 --- a/integration/container_stats_test.go +++ b/integration/container_stats_test.go @@ -75,11 +75,7 @@ func TestContainerConsumedStats(t *testing.T) { sb, sbConfig := PodSandboxConfigWithCleanup(t, "sandbox1", "stats") testImage := GetImage(ResourceConsumer) - img, err := imageService.PullImage(&runtime.ImageSpec{Image: testImage}, nil, sbConfig) - require.NoError(t, err) - defer func() { - assert.NoError(t, imageService.RemoveImage(&runtime.ImageSpec{Image: img})) - }() + EnsureImageExists(t, testImage) t.Logf("Create a container config and run container in a pod") containerConfig := ContainerConfig(