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 <cbelu@cloudbasesolutions.com>
This commit is contained in:
parent
a78bdf22df
commit
cabe677369
@ -75,11 +75,7 @@ func TestContainerConsumedStats(t *testing.T) {
|
|||||||
sb, sbConfig := PodSandboxConfigWithCleanup(t, "sandbox1", "stats")
|
sb, sbConfig := PodSandboxConfigWithCleanup(t, "sandbox1", "stats")
|
||||||
|
|
||||||
testImage := GetImage(ResourceConsumer)
|
testImage := GetImage(ResourceConsumer)
|
||||||
img, err := imageService.PullImage(&runtime.ImageSpec{Image: testImage}, nil, sbConfig)
|
EnsureImageExists(t, testImage)
|
||||||
require.NoError(t, err)
|
|
||||||
defer func() {
|
|
||||||
assert.NoError(t, imageService.RemoveImage(&runtime.ImageSpec{Image: img}))
|
|
||||||
}()
|
|
||||||
|
|
||||||
t.Logf("Create a container config and run container in a pod")
|
t.Logf("Create a container config and run container in a pod")
|
||||||
containerConfig := ContainerConfig(
|
containerConfig := ContainerConfig(
|
||||||
|
Loading…
Reference in New Issue
Block a user