Skip to content

Commit ad9d4e7

Browse files
tkashembertinatto
authored andcommitted
UPSTREAM: <carry>: fix [sig-auth] ServiceAccounts no secret-based service account token should be auto-generated
OpenShift-Rebase-Source: a031438 UPSTREAM: <carry>: fix [sig-auth] ServiceAccounts no secret-based service account token should be auto-generated
1 parent 8c3c0fa commit ad9d4e7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/e2e/auth/service_accounts.go

+11
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ var _ = SIGDescribe("ServiceAccounts", func() {
6464
time.Sleep(10 * time.Second)
6565
sa, err := f.ClientSet.CoreV1().ServiceAccounts(f.Namespace.Name).Get(ctx, "default", metav1.GetOptions{})
6666
framework.ExpectNoError(err)
67+
68+
// TODO: Ignore the image pull secret that OpenShift sometimes creates and adds to the list of Secrets.
69+
// TODO: This patch can be removed once OpenShift stops adding the pull secret to the list of secrets in 4.16.
70+
secrets := sa.DeepCopy().Secrets
71+
sa.Secrets = nil
72+
for _, s := range secrets {
73+
if strings.HasPrefix(s.Name, "default-dockercfg") {
74+
continue
75+
}
76+
sa.Secrets = append(sa.Secrets, s)
77+
}
6778
gomega.Expect(sa.Secrets).To(gomega.BeEmpty())
6879
}
6980
})

0 commit comments

Comments
 (0)