From 64c41162c3acb0b75c7a4ab82e5751165ceabf5e Mon Sep 17 00:00:00 2001 From: Akhil Mohan Date: Wed, 18 Oct 2023 23:56:19 +0530 Subject: [PATCH] update tests to use labels from cri/labels Signed-off-by: Akhil Mohan --- pkg/cri/server/helpers_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/cri/server/helpers_test.go b/pkg/cri/server/helpers_test.go index 572eea11e..bebd47550 100644 --- a/pkg/cri/server/helpers_test.go +++ b/pkg/cri/server/helpers_test.go @@ -29,6 +29,7 @@ import ( "github.com/containerd/containerd/v2/containers" "github.com/containerd/containerd/v2/oci" criconfig "github.com/containerd/containerd/v2/pkg/cri/config" + crilabels "github.com/containerd/containerd/v2/pkg/cri/labels" containerstore "github.com/containerd/containerd/v2/pkg/cri/store/container" "github.com/containerd/containerd/v2/plugins" "github.com/containerd/containerd/v2/protobuf/types" @@ -99,16 +100,16 @@ func TestBuildLabels(t *testing.T) { "a": "b", "c": "d", } - newLabels := buildLabels(configLabels, imageConfigLabels, containerKindSandbox) + newLabels := buildLabels(configLabels, imageConfigLabels, crilabels.ContainerKindSandbox) assert.Len(t, newLabels, 4) assert.Equal(t, "b", newLabels["a"]) assert.Equal(t, "d", newLabels["c"]) assert.Equal(t, "y", newLabels["d"]) - assert.Equal(t, containerKindSandbox, newLabels[containerKindLabel]) + assert.Equal(t, crilabels.ContainerKindSandbox, newLabels[crilabels.ContainerKindLabel]) assert.NotContains(t, newLabels, "long-label") newLabels["a"] = "e" - assert.Empty(t, configLabels[containerKindLabel], "should not add new labels into original label") + assert.Empty(t, configLabels[crilabels.ContainerKindLabel], "should not add new labels into original label") assert.Equal(t, "b", configLabels["a"], "change in new labels should not affect original label") }