Add check for error in listing ServiceAccounts

This commit is contained in:
Caleb Woodbine 2020-04-22 12:08:00 +12:00
parent c6e1701bda
commit 9a53b0ec57

View File

@ -678,6 +678,7 @@ var _ = SIGDescribe("ServiceAccounts", func() {
ginkgo.By("finding ServiceAccount in list of all ServiceAccounts (by LabelSelector)")
serviceAccountList, err := f.ClientSet.CoreV1().ServiceAccounts("").List(context.TODO(), metav1.ListOptions{LabelSelector: testServiceAccountStaticLabelsFlat})
framework.ExpectNoError(err, "failed to list ServiceAccounts by LabelSelector")
foundServiceAccount := false
for _, serviceAccountItem := range serviceAccountList.Items {
if serviceAccountItem.ObjectMeta.Name == testServiceAccountName && serviceAccountItem.ObjectMeta.Namespace == testNamespaceName && *serviceAccountItem.AutomountServiceAccountToken == boolFalse {