Skip to content

Commit

Permalink
bgp,test: Properly wait for FRR container to be ready
Browse files Browse the repository at this point in the history
PodIP will be assigned even if the containers are not ready. Don't
waiting for the actual readiness state here causes unexpected error in
the later test case. For example, when FRR container is not brought up
with image pull failure, the later "Connectivity to endpoint via LB"
test fails because no one installs the route to the kernel FIB.

Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
  • Loading branch information
YutaroHayakawa authored and borkmann committed Jun 5, 2023
1 parent 12a3adf commit cb19fd2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/k8s/bgp.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,15 @@ var _ = SkipDescribeIf(
frr = applyFRRTemplate(kubectl, ni)
kubectl.ApplyDefault(frr).ExpectSuccess("Unable to apply rendered template %s", frr)

Eventually(func() string {
frrPod, err := kubectl.GetPodsIPs(helpers.KubeSystemNamespace, "app=frr")
if _, ok := frrPod["frr"]; err != nil || !ok {
return ""
}
routerIP = frrPod["frr"]
return routerIP
}, 30*time.Second, 1*time.Second).Should(Not(BeEmpty()), "BGP router is not ready")
err := kubectl.WaitForSinglePod("kube-system", "frr", 30*time.Second)
ExpectWithOffset(1, err).ShouldNot(HaveOccurred(), "Failed to wait for FRR Pod")

frrPod, err := kubectl.GetPodsIPs(helpers.KubeSystemNamespace, "app=frr")
ExpectWithOffset(1, err).ShouldNot(HaveOccurred(), "Cannot determine FRR Pod IPs")

var ok bool
routerIP, ok = frrPod["frr"]
Expect(ok).To(BeTrue())

bgpConfigMap = applyBGPCMTemplate(kubectl, routerIP)
kubectl.ApplyDefault(bgpConfigMap).ExpectSuccess("Unable to apply BGP ConfigMap %s", bgpConfigMap)
Expand All @@ -92,7 +93,6 @@ var _ = SkipDescribeIf(
demoDS = helpers.ManifestGet(kubectl.BasePath(), "demo_ds.yaml")
kubectl.ApplyDefault(demoDS).ExpectSuccess("Unable to apply %s", demoDS)

var err error
ciliumPodK8s1, err = kubectl.GetCiliumPodOnNode(helpers.K8s1)
ExpectWithOffset(1, err).ShouldNot(HaveOccurred(), "Cannot determine cilium pod name")
ciliumPodK8s2, err = kubectl.GetCiliumPodOnNode(helpers.K8s2)
Expand Down

0 comments on commit cb19fd2

Please sign in to comment.