diff --git a/.github/workflows/cts.yaml b/.github/workflows/cts.yaml index 5e628263..7cff44d3 100644 --- a/.github/workflows/cts.yaml +++ b/.github/workflows/cts.yaml @@ -135,7 +135,7 @@ jobs: repository: ghcr.io/${{ github.repository }} tag: ${{ github.ref_name }} - name: Deploy emqx - timeout-minutes: 5 + timeout-minutes: 10 uses: ./.github/actions/deploy-emqx with: kind: ${{ matrix.emqx[0] }} diff --git a/controllers/apps/v2beta1/emqx_controller.go b/controllers/apps/v2beta1/emqx_controller.go index 1ca8f49f..a66cfa42 100644 --- a/controllers/apps/v2beta1/emqx_controller.go +++ b/controllers/apps/v2beta1/emqx_controller.go @@ -121,6 +121,7 @@ func (r *EMQXReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl. for _, subReconciler := range []subReconciler{ &addBootstrap{r}, + &updatePodConditions{r}, &updateStatus{r}, &addCore{r}, &addRepl{r}, @@ -198,13 +199,17 @@ func newRequester(ctx context.Context, k8sClient client.Client, instance *appsv2 }) for _, pod := range podList.Items { - if pod.GetDeletionTimestamp() == nil && pod.Status.Phase == corev1.PodRunning && pod.Status.PodIP != "" { - return &innerReq.Requester{ - Schema: schema, - Host: net.JoinHostPort(pod.Status.PodIP, port), - Username: username, - Password: password, - }, nil + if pod.GetDeletionTimestamp() == nil && pod.Status.PodIP != "" { + for _, cond := range pod.Status.Conditions { + if cond.Type == corev1.ContainersReady && cond.Status == corev1.ConditionTrue { + return &innerReq.Requester{ + Schema: schema, + Host: net.JoinHostPort(pod.Status.PodIP, port), + Username: username, + Password: password, + }, nil + } + } } }