Skip to content

Commit

Permalink
ci: fix Constellation recover e2e test (#1081)
Browse files Browse the repository at this point in the history
* AB#2859 wait for cp to recover

* AB#2859 remove unnecessary inputs & echo
  • Loading branch information
msanft authored Jan 27, 2023
1 parent fb1b1f5 commit cb894e5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
33 changes: 22 additions & 11 deletions .github/actions/e2e_recover/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@ inputs:
masterSecret:
description: "The master-secret for the cluster."
required: true
cloudProvider:
description: "Which cloud provider to use."
required: true
gcpProject:
description: "The GCP project Constellation is deployed in."
required: false
resourceGroup:
description: "The Azure resource group Constellation is deployed in."
required: false

runs:
using: "composite"
Expand Down Expand Up @@ -55,7 +46,7 @@ runs:
i=$(echo "$output" | grep -o "Pushed recovery key." | wc -l | sed 's/ //g')
recovered=$((recovered+i))
if [[ $recovered -eq ${{ inputs.controlNodesCount }} ]]; then
exit 0
break
fi
fi
Expand All @@ -68,6 +59,26 @@ runs:
echo "Did not recover all nodes yet, retrying in 5 seconds [$recovered/${{ inputs.controlNodesCount }}]"
sleep 5
done
kubectl wait --for=condition=Ready --timeout=10m --all nodes
- name: Wait for control plane to get back up
shell: bash
run: |
timeout=600
start_time=$(date +%s)
while true; do
output=$(kubectl wait --for=condition=Ready --timeout=10m --all nodes || true)
if echo "$output" | grep -q "condition met"; then
echo "$output"
exit 0
fi
current_time=$(date +%s)
if ((current_time - start_time > timeout)); then
echo "Waiting for control plane to get back up timed out after $timeout seconds."
exit 1
fi
echo "Cannot reach control plane, retrying in 10 seconds"
sleep 10
done
env:
KUBECONFIG: ${{ inputs.kubeconfig }}
3 changes: 0 additions & 3 deletions .github/actions/e2e_test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,5 @@ runs:
uses: ./.github/actions/e2e_recover
with:
controlNodesCount: ${{ inputs.controlNodesCount }}
cloudProvider: ${{ inputs.cloudProvider }}
gcpProject: ${{ inputs.gcpProject }}
kubeconfig: ${{ steps.constellation-create.outputs.kubeconfig }}
masterSecret: ${{ steps.constellation-create.outputs.masterSecret }}
azureResourceGroup: ${{ inputs.azureResourceGroup }}

0 comments on commit cb894e5

Please sign in to comment.