Merge pull request #108757 from liggitt/service-account-conformance

Exercise Get of serviceaccount in e2e
This commit is contained in:
Kubernetes Prow Robot 2022-03-17 00:41:30 -07:00 committed by GitHub
commit 48ee98fabf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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})