Skip to content

Commit

Permalink
Wait for the UDN namespaces to have SA's created
Browse files Browse the repository at this point in the history
Should fix:

pods "red-pod-0" is forbidden: error looking up service account e2e-network-segmentation-e2e-6878-red/default: serviceaccount "default" not found
    {
        ErrStatus:
            code: 403
            details:
              kind: pods
              name: red-pod-0
            message: 'pods "red-pod-0" is forbidden: error looking up service account e2e-network-segmentation-e2e-6878-red/default:
              serviceaccount "default" not found'
            metadata: {}
            reason: Forbidden
            status: Failure,

Signed-off-by: Surya Seetharaman <[email protected]>
  • Loading branch information
tssurya committed Feb 3, 2025
1 parent d8e21e6 commit a3f4d4d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/extended/networking/network_segmentation.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,8 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
},
}, metav1.CreateOptions{})
Expect(err).NotTo(HaveOccurred())
err = udnWaitForOpenShift(oc, namespace)
Expect(err).NotTo(HaveOccurred())
defer func() {
By("Removing namespace " + namespace)
Expect(cs.CoreV1().Namespaces().Delete(
Expand Down Expand Up @@ -859,6 +861,8 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
Labels: map[string]string{RequiredUDNNamespaceLabel: ""},
}}, metav1.CreateOptions{})
Expect(err).NotTo(HaveOccurred())
err = udnWaitForOpenShift(oc, nsName)
Expect(err).NotTo(HaveOccurred())
DeferCleanup(func() error {
err := cs.CoreV1().Namespaces().Delete(context.Background(), nsName, metav1.DeleteOptions{})
return err
Expand Down Expand Up @@ -944,6 +948,8 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
Labels: map[string]string{RequiredUDNNamespaceLabel: ""},
}}, metav1.CreateOptions{})
Expect(err).NotTo(HaveOccurred())
err = udnWaitForOpenShift(oc, testNewNs)
Expect(err).NotTo(HaveOccurred())
DeferCleanup(func() error {
err := cs.CoreV1().Namespaces().Delete(context.Background(), testNewNs, metav1.DeleteOptions{})
return err
Expand Down Expand Up @@ -973,6 +979,8 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
Labels: map[string]string{RequiredUDNNamespaceLabel: ""},
}}, metav1.CreateOptions{})
Expect(err).NotTo(HaveOccurred())
err = udnWaitForOpenShift(oc, testNewNs)
Expect(err).NotTo(HaveOccurred())
DeferCleanup(func() error {
err := cs.CoreV1().Namespaces().Delete(context.Background(), testNewNs, metav1.DeleteOptions{})
return err
Expand Down Expand Up @@ -1107,6 +1115,8 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User
Labels: map[string]string{RequiredUDNNamespaceLabel: ""},
}}, metav1.CreateOptions{})
Expect(err).NotTo(HaveOccurred())
err = udnWaitForOpenShift(oc, nsName)
Expect(err).NotTo(HaveOccurred())
DeferCleanup(func() error {
err := cs.CoreV1().Namespaces().Delete(context.Background(), nsName, metav1.DeleteOptions{})
return err
Expand Down

0 comments on commit a3f4d4d

Please sign in to comment.