From 654dc8686bf4cbb727c6902be28724ab0bedd5c3 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Wed, 16 Mar 2022 20:24:50 -0400 Subject: [PATCH] Exercise Get of serviceaccount in e2e --- test/e2e/auth/service_accounts.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/e2e/auth/service_accounts.go b/test/e2e/auth/service_accounts.go index d8b29ffbd80..a8b3c269906 100644 --- a/test/e2e/auth/service_accounts.go +++ b/test/e2e/auth/service_accounts.go @@ -646,9 +646,13 @@ var _ = SIGDescribe("ServiceAccounts", func() { Labels: testServiceAccountStaticLabels, }, } - _, err := f.ClientSet.CoreV1().ServiceAccounts(testNamespaceName).Create(context.TODO(), &testServiceAccount, metav1.CreateOptions{}) + createdServiceAccount, err := f.ClientSet.CoreV1().ServiceAccounts(testNamespaceName).Create(context.TODO(), &testServiceAccount, metav1.CreateOptions{}) framework.ExpectNoError(err, "failed to create a ServiceAccount") + getServiceAccount, err := f.ClientSet.CoreV1().ServiceAccounts(testNamespaceName).Get(context.TODO(), testServiceAccountName, metav1.GetOptions{}) + framework.ExpectNoError(err, "failed to fetch the created ServiceAccount") + framework.ExpectEqual(createdServiceAccount.UID, getServiceAccount.UID) + ginkgo.By("watching for the ServiceAccount to be added") resourceWatchTimeoutSeconds := int64(180) resourceWatch, err := f.ClientSet.CoreV1().ServiceAccounts(testNamespaceName).Watch(context.TODO(), metav1.ListOptions{LabelSelector: testServiceAccountStaticLabelsFlat, TimeoutSeconds: &resourceWatchTimeoutSeconds})