From aa75a065d7a79cf63f3dde9d1b34333440e156fb Mon Sep 17 00:00:00 2001 From: Malte Poll Date: Fri, 9 Sep 2022 13:28:53 +0200 Subject: [PATCH] e2e test: wait for specified amount of nodes to join the cluster and become ready (#87) Co-authored-by: Nils Hanke --- .../actions/constellation_create/action.yml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/actions/constellation_create/action.yml b/.github/actions/constellation_create/action.yml index 1ef6670ea..072cba5fb 100644 --- a/.github/actions/constellation_create/action.yml +++ b/.github/actions/constellation_create/action.yml @@ -155,11 +155,36 @@ runs: if: ${{ inputs.isDebugImage == 'true' }} - name: Constellation init + id: constellation-init run: | if [ ${{ inputs.autoscale }} = true ]; then autoscale=--autoscale; fi constellation init ${autoscale} + echo "::set-output name=KUBECONFIG::$(pwd)/constellation-admin.conf" shell: bash + - name: Wait for nodes to join and become ready + run: | + echo "::group::Wait for nodes" + NODES_COUNT=$((${{ inputs.controlNodesCount }} + ${{ inputs.workerNodesCount }})) + JOINWAIT=0 + until [ "$(kubectl get nodes -o json | jq '.items | length')" == "${NODES_COUNT}" ] || [ $JOINWAIT -gt $JOINTIMEOUT ]; + do + echo "$(kubectl get nodes -o json | jq '.items | length')/"${NODES_COUNT}" nodes have joined.. waiting.." + JOINWAIT=$((JOINWAIT+30)) + sleep 30 + done + if [ $JOINWAIT -gt $JOINTIMEOUT ]; then + echo "Timed out waiting for nodes to join" + exit 1 + fi + echo "$(kubectl get nodes -o json | jq '.items | length')/"${NODES_COUNT}" nodes have joined" + kubectl wait --for=condition=ready --all nodes --timeout=10m + echo "::endgroup::" + shell: bash + env: + KUBECONFIG: "${{ steps.constellation-init.outputs.KUBECONFIG }}" + JOINTIMEOUT: "1200" # 20 minutes timeout for all nodes to join + - name: Download boot logs run: | echo "::group::Download boot logs"