Skip to content

Commit 3bd377f

Browse files
Amend kubectl wait statements
Signed-off-by: Kate Goldenring <[email protected]>
1 parent 89195ef commit 3bd377f

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

node-installer/tests/integration-test-k3s.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ echo "Applying KWasm node installer job..."
5151
kubectl apply -f ./k3s-kwasm-job.yml
5252

5353
echo "Waiting for node installer job to complete..."
54-
kubectl wait -n kwasm --for=jsonpath='{.status.phase}'=Succeeded pod --selector=job-name=k3s-provision-kwasm --timeout=60s
54+
if ! kubectl wait -n kwasm --for=jsonpath='{.status.phase}'=Succeeded pod --selector=job-name=k3s-provision-kwasm --timeout=60s; then
55+
echo "Node installer job failed!"
56+
kubectl describe pod -n kwasm
57+
exit 1
58+
fi
5559

5660
# Verify the SystemdCgroup is set to true
5761
if sudo cat /var/lib/rancher/k3s/agent/etc/containerd/config.toml | grep -A2 "runtimes.spin.options" | grep -q "SystemdCgroup = true"; then
@@ -72,7 +76,11 @@ sudo k3s ctr images pull ghcr.io/spinkube/containerd-shim-spin/examples/spin-rus
7276
kubectl apply -f ./tests/workloads/workload.yaml
7377

7478
echo "Waiting for deployment to be ready..."
75-
kubectl wait --for=condition=Available deployment/wasm-spin --timeout=120s
79+
if ! kubectl wait --for=condition=Available deployment/wasm-spin --timeout=120s; then
80+
echo "Deployment failed to become ready!"
81+
kubectl describe deployment wasm-spin
82+
exit 1
83+
fi
7684

7785
echo "Checking pod status..."
7886
kubectl get pods

node-installer/tests/integration-test-microk8s.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ echo "=== Step 4: Apply the workload ==="
8080
kubectl apply -f ./tests/workloads/workload.yaml
8181

8282
echo "Waiting for deployment to be ready..."
83-
if kubectl wait --for=condition=Available deployment/wasm-spin --timeout=120s; then
83+
if ! kubectl wait --for=condition=Available deployment/wasm-spin --timeout=120s; then
8484
echo "Deployment failed to become ready!"
8585
kubectl describe deployment wasm-spin
8686
exit 1

node-installer/tests/integration-test-minikube.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ echo "Applying KWasm node installer job..."
4141
kubectl apply -f ./minikube-kwasm-job.yml
4242

4343
echo "Waiting for node installer job to complete..."
44-
kubectl wait -n kwasm --for=condition=Ready pod --selector=job-name=minikube-provision-kwasm --timeout=90s || true
45-
kubectl wait -n kwasm --for=jsonpath='{.status.phase}'=Succeeded pod --selector=job-name=minikube-provision-kwasm --timeout=60s
44+
if ! kubectl wait -n kwasm --for=jsonpath='{.status.phase}'=Succeeded pod --selector=job-name=minikube-provision-kwasm --timeout=60s; then
45+
echo "Node installer job failed!"
46+
kubectl describe pod -n kwasm
47+
exit 1
48+
fi
4649

4750
# Verify the SystemdCgroup is set to true
4851
if docker exec $NODE_NAME cat /etc/containerd/config.toml | grep -A5 "spin" | grep -q "SystemdCgroup = true"; then
@@ -62,7 +65,11 @@ echo "=== Step 4: Apply the workload ==="
6265
kubectl apply -f ./tests/workloads/workload.yaml
6366

6467
echo "Waiting for deployment to be ready..."
65-
kubectl wait --for=condition=Available deployment/wasm-spin --timeout=120s
68+
if ! kubectl wait --for=condition=Available deployment/wasm-spin --timeout=120s; then
69+
echo "Deployment failed to become ready!"
70+
kubectl describe po wasm-spin
71+
exit 1
72+
fi
6673

6774
echo "Checking pod status..."
6875
kubectl get pods

0 commit comments

Comments
 (0)