From ea356bb104440e6b660f5e64b415a469e7ff83cd Mon Sep 17 00:00:00 2001 From: Markus Rudy Date: Thu, 21 Nov 2024 18:56:01 +0100 Subject: [PATCH] e2e: minor improvements to test-peerpods.sh * wait for Kata runtime to be available * print CAA logs on error * treat unset azure_image_id as empty --- packages/test-peerpods.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/test-peerpods.sh b/packages/test-peerpods.sh index e7ca1a494..c2e3dc15b 100644 --- a/packages/test-peerpods.sh +++ b/packages/test-peerpods.sh @@ -6,7 +6,7 @@ set -euo pipefail set -x -if [ -z "${azure_image_id}" ]; then +if [ -z "${azure_image_id:-}" ]; then nix run -L .#scripts.upload-image -- \ --subscription-id="${azure_subscription_id:?}" \ --location="${azure_location:?}" \ @@ -23,6 +23,22 @@ just create AKS-PEER-SNP just get-credentials AKS-PEER-SNP just node-installer AKS-PEER-SNP +set +x +found=false +for _ in $(seq 30); do + if kubectl get runtimeclass | grep -q kata-remote; then + found=true + break + fi + echo "Waiting for Kata installation to succeed ..." + sleep 10 +done + +if [[ $found != true ]]; then + echo "Kata RuntimeClass not ready" >&2 + exit 1 +fi + cleanup() { kubectl delete deploy nginx kubectl wait --for=delete pod --selector=app=nginx --timeout=5m @@ -30,6 +46,8 @@ cleanup() { trap cleanup EXIT +set -x + kubectl apply -f - <