From 04cecdb5a0a52466361237d6f82841194f031682 Mon Sep 17 00:00:00 2001 From: Michael Nguyen Date: Thu, 14 Dec 2023 14:45:14 -0500 Subject: [PATCH] mantle/kola/tests/crio: update tests for new cri-tools Cri-tools 1.29[0] now pre-validates container metadata before running with crictl[1]. The required uid field was missing in our test causing the following failure. ``` load podSandboxConfig: name, namespace or uid is not in metadata \"&PodSandboxMetadata{Name:rhcos-crio-pod-restart-test,Uid:,Namespace:redhat.test.crio,Attempt:0,}\ ``` [0] https://github.com/kubernetes-sigs/cri-tools/releases/tag/v1.29.0 [1] https://github.com/kubernetes-sigs/cri-tools/pull/1274 --- mantle/kola/tests/crio/crio.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mantle/kola/tests/crio/crio.go b/mantle/kola/tests/crio/crio.go index 5ea7731f97..30d2b45e55 100644 --- a/mantle/kola/tests/crio/crio.go +++ b/mantle/kola/tests/crio/crio.go @@ -32,6 +32,8 @@ import ( "github.com/coreos/coreos-assembler/mantle/lang/worker" "github.com/coreos/coreos-assembler/mantle/platform" "github.com/coreos/coreos-assembler/mantle/platform/conf" + + "github.com/google/uuid" ) // simplifiedCrioInfo represents the results from crio info @@ -51,7 +53,8 @@ const overrideCrioOperationTimeoutSeconds = "300s" var crioPodTemplate = `{ "metadata": { "name": "rhcos-crio-pod-%s", - "namespace": "redhat.test.crio" + "namespace": "redhat.test.crio", + "uid": "%s" }, "image": { "image": "localhost/%s:latest" @@ -220,7 +223,7 @@ func crioBaseTests(c cluster.TestCluster) { // generateCrioConfig generates a crio pod/container configuration // based on the input name and arguments returning the path to the generated configs. func generateCrioConfig(podName, imageName string, command []string) (string, string, error) { - fileContentsPod := fmt.Sprintf(crioPodTemplate, podName, imageName) + fileContentsPod := fmt.Sprintf(crioPodTemplate, podName, uuid.New().String(), imageName) tmpFilePod, err := os.CreateTemp("", podName+"Pod") if err != nil {