Skip to content

Commit 16cd6ed

Browse files
author
zounengren
committed
Additional integration tests for pulling image with labels
Signed-off-by: Zou Nengren <[email protected]>
1 parent 8e850bc commit 16cd6ed

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

integration/containerd_image_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func TestContainerdImage(t *testing.T) {
4444
}
4545

4646
t.Logf("pull the image into containerd")
47-
_, err = containerdClient.Pull(ctx, testImage, containerd.WithPullUnpack)
47+
_, err = containerdClient.Pull(ctx, testImage, containerd.WithPullUnpack, containerd.WithPullLabel("foo", "bar"))
4848
assert.NoError(t, err)
4949
defer func() {
5050
// Make sure the image is cleaned up in any case.
@@ -121,6 +121,11 @@ func TestContainerdImage(t *testing.T) {
121121
assert.NoError(t, err)
122122
assert.Equal(t, imgByID.Labels()["io.cri-containerd.image"], "managed")
123123

124+
t.Logf("the image should be labeled")
125+
img, err := containerdClient.GetImage(ctx, testImage)
126+
assert.NoError(t, err)
127+
assert.Equal(t, img.Labels()["foo"], "bar")
128+
124129
t.Logf("should be able to start container with the image")
125130
sb, sbConfig := PodSandboxConfigWithCleanup(t, "sandbox", "containerd-image")
126131

0 commit comments

Comments
 (0)