Merge pull request #110287 from neolit123/1.25-add-url-scheme-e2e-test-for-cri-socket

test/e2e_kubeadm: add URL scheme test for node CRI annotations
This commit is contained in:
Kubernetes Prow Robot 2022-05-30 19:52:52 -07:00 committed by GitHub
commit aae07c6f7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,7 @@ package kubeadm
import ( import (
"context" "context"
rbacv1 "k8s.io/api/rbac/v1" rbacv1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
@ -51,9 +52,11 @@ var _ = Describe("nodes", func() {
List(context.TODO(), metav1.ListOptions{}) List(context.TODO(), metav1.ListOptions{})
framework.ExpectNoError(err, "error reading nodes") 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 { for _, node := range nodes.Items {
gomega.Expect(node.Annotations).To(gomega.HaveKey(nodesCRISocketAnnotation)) gomega.Expect(node.Annotations).To(gomega.HaveKey(nodesCRISocketAnnotation))
gomega.Expect(node.Annotations[nodesCRISocketAnnotation]).To(gomega.HavePrefix("unix://"))
} }
}) })