mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
Exercise Get of serviceaccount in e2e
This commit is contained in:
parent
2b1b849d6a
commit
654dc8686b
@ -646,9 +646,13 @@ var _ = SIGDescribe("ServiceAccounts", func() {
|
|||||||
Labels: testServiceAccountStaticLabels,
|
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")
|
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")
|
ginkgo.By("watching for the ServiceAccount to be added")
|
||||||
resourceWatchTimeoutSeconds := int64(180)
|
resourceWatchTimeoutSeconds := int64(180)
|
||||||
resourceWatch, err := f.ClientSet.CoreV1().ServiceAccounts(testNamespaceName).Watch(context.TODO(), metav1.ListOptions{LabelSelector: testServiceAccountStaticLabelsFlat, TimeoutSeconds: &resourceWatchTimeoutSeconds})
|
resourceWatch, err := f.ClientSet.CoreV1().ServiceAccounts(testNamespaceName).Watch(context.TODO(), metav1.ListOptions{LabelSelector: testServiceAccountStaticLabelsFlat, TimeoutSeconds: &resourceWatchTimeoutSeconds})
|
||||||
|
Loading…
Reference in New Issue
Block a user