mirror of
https://github.com/netbirdio/kubernetes-operator.git
synced 2026-05-22 17:11:40 -07:00
Fix flaky e2e tests (#120)
This change fixes flaky e2e tests with two changes. The first is that the manager container is checked for ready condition rather than running. The second is that the webhook server has been registered as part of the health check to verify it is running before reporting ready state. Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
+2
-1
@@ -224,6 +224,7 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
if len(netbirdAPIKey) > 0 {
|
||||
if err = (&controller.NBRoutingPeerReconciler{
|
||||
Client: mgr.GetClient(),
|
||||
@@ -314,7 +315,7 @@ func main() {
|
||||
setupLog.Error(err, "unable to set up health check")
|
||||
os.Exit(1)
|
||||
}
|
||||
if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil {
|
||||
if err := mgr.AddReadyzCheck("readyz", mgr.GetWebhookServer().StartedChecker()); err != nil {
|
||||
setupLog.Error(err, "unable to set up ready check")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
@@ -155,12 +155,13 @@ var _ = Describe("Manager", Ordered, func() {
|
||||
|
||||
// Validate the pod's status
|
||||
cmd = exec.Command("kubectl", "get",
|
||||
"pods", controllerPodName, "-o", "jsonpath={.status.phase}",
|
||||
"pods", controllerPodName,
|
||||
"-o", "jsonpath={.status.conditions[?(@.type=='Ready')].status}",
|
||||
"-n", namespace,
|
||||
)
|
||||
output, err := utils.Run(cmd)
|
||||
g.Expect(err).NotTo(HaveOccurred())
|
||||
g.Expect(output).To(Equal("Running"), "Incorrect kubernetes-operator pod status")
|
||||
g.Expect(output).To(Equal("True"), "Incorrect kubernetes-operator pod status")
|
||||
}
|
||||
Eventually(verifyControllerUp).Should(Succeed())
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user