mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Add check for error in listing ServiceAccounts
This commit is contained in:
parent
c6e1701bda
commit
9a53b0ec57
@ -678,6 +678,7 @@ var _ = SIGDescribe("ServiceAccounts", func() {
|
|||||||
|
|
||||||
ginkgo.By("finding ServiceAccount in list of all ServiceAccounts (by LabelSelector)")
|
ginkgo.By("finding ServiceAccount in list of all ServiceAccounts (by LabelSelector)")
|
||||||
serviceAccountList, err := f.ClientSet.CoreV1().ServiceAccounts("").List(context.TODO(), metav1.ListOptions{LabelSelector: testServiceAccountStaticLabelsFlat})
|
serviceAccountList, err := f.ClientSet.CoreV1().ServiceAccounts("").List(context.TODO(), metav1.ListOptions{LabelSelector: testServiceAccountStaticLabelsFlat})
|
||||||
|
framework.ExpectNoError(err, "failed to list ServiceAccounts by LabelSelector")
|
||||||
foundServiceAccount := false
|
foundServiceAccount := false
|
||||||
for _, serviceAccountItem := range serviceAccountList.Items {
|
for _, serviceAccountItem := range serviceAccountList.Items {
|
||||||
if serviceAccountItem.ObjectMeta.Name == testServiceAccountName && serviceAccountItem.ObjectMeta.Namespace == testNamespaceName && *serviceAccountItem.AutomountServiceAccountToken == boolFalse {
|
if serviceAccountItem.ObjectMeta.Name == testServiceAccountName && serviceAccountItem.ObjectMeta.Namespace == testNamespaceName && *serviceAccountItem.AutomountServiceAccountToken == boolFalse {
|
||||||
|
Loading…
Reference in New Issue
Block a user