Skip to content

Commit bf7b0b3

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 42ea46b commit bf7b0b3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: test/e2e/auth/service_accounts.go

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

0 commit comments

Comments
 (0)