From 2a18a2d59b64a1e5e1296c645b8f7c1f60aa8a9f Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Mon, 30 May 2022 17:06:08 +0300 Subject: [PATCH] test/e2e_kubeadm: add URL scheme test for node CRI annotations The tests in nodes_test.go check if the Node objects in a kubeadm cluster are annotated with a CRI socket path. It is used by kubeadm to store a CRI socket per node. Add a new test condition to verify if the CRI socket path is prefixed with URL scheme "unix://". --- test/e2e_kubeadm/nodes_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/e2e_kubeadm/nodes_test.go b/test/e2e_kubeadm/nodes_test.go index dbf1d4eb3fa..9d94b3a89a0 100644 --- a/test/e2e_kubeadm/nodes_test.go +++ b/test/e2e_kubeadm/nodes_test.go @@ -18,6 +18,7 @@ package kubeadm import ( "context" + rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/kubernetes/test/e2e/framework" @@ -51,9 +52,11 @@ var _ = Describe("nodes", func() { List(context.TODO(), metav1.ListOptions{}) framework.ExpectNoError(err, "error reading nodes") - // checks that the nodes have the CRI annotation + // Checks that the nodes have the CRI socket annotation + // and that it is prefixed with a URL scheme for _, node := range nodes.Items { gomega.Expect(node.Annotations).To(gomega.HaveKey(nodesCRISocketAnnotation)) + gomega.Expect(node.Annotations[nodesCRISocketAnnotation]).To(gomega.HavePrefix("unix://")) } })