From e56619b21ded7a00bc3519692035cdd62e8be97e Mon Sep 17 00:00:00 2001 From: Nicolas Busseneau Date: Thu, 1 Jul 2021 19:09:19 +0200 Subject: [PATCH] workflows: check status of Relay port-forward Since we start a background process for port-forwarding Relay, we must check if it actually succeeded or failed before allowing workflows to continue. We also standardize a 10s allowance time for port-forward to start. Signed-off-by: Nicolas Busseneau --- .github/in-cluster-test-scripts/eks-tunnel.sh | 1 + .github/in-cluster-test-scripts/eks.sh | 1 + .github/in-cluster-test-scripts/gke.sh | 1 + .github/workflows/aks.yaml | 3 ++- .github/workflows/kind.yaml | 6 ++++-- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/in-cluster-test-scripts/eks-tunnel.sh b/.github/in-cluster-test-scripts/eks-tunnel.sh index cae468d8cc..3aa1cc1c98 100644 --- a/.github/in-cluster-test-scripts/eks-tunnel.sh +++ b/.github/in-cluster-test-scripts/eks-tunnel.sh @@ -12,6 +12,7 @@ cilium status --wait # Port forward Relay cilium hubble port-forward& sleep 10s +[[ $(pgrep -f "cilium hubble port-forward|kubectl port-forward.*hubble-relay" | wc -l) == 2 ]] # Run connectivity test cilium connectivity test --all-flows diff --git a/.github/in-cluster-test-scripts/eks.sh b/.github/in-cluster-test-scripts/eks.sh index cae468d8cc..3aa1cc1c98 100644 --- a/.github/in-cluster-test-scripts/eks.sh +++ b/.github/in-cluster-test-scripts/eks.sh @@ -12,6 +12,7 @@ cilium status --wait # Port forward Relay cilium hubble port-forward& sleep 10s +[[ $(pgrep -f "cilium hubble port-forward|kubectl port-forward.*hubble-relay" | wc -l) == 2 ]] # Run connectivity test cilium connectivity test --all-flows diff --git a/.github/in-cluster-test-scripts/gke.sh b/.github/in-cluster-test-scripts/gke.sh index a3cb385186..d3cccd2ea9 100644 --- a/.github/in-cluster-test-scripts/gke.sh +++ b/.github/in-cluster-test-scripts/gke.sh @@ -18,6 +18,7 @@ cilium status --wait # Port forward Relay cilium hubble port-forward& sleep 10s +[[ $(pgrep -f "cilium hubble port-forward|kubectl port-forward.*hubble-relay" | wc -l) == 2 ]] # Run connectivity test cilium connectivity test --all-flows diff --git a/.github/workflows/aks.yaml b/.github/workflows/aks.yaml index 9806c504c7..150b5dbe2b 100644 --- a/.github/workflows/aks.yaml +++ b/.github/workflows/aks.yaml @@ -109,7 +109,8 @@ jobs: - name: Port forward Relay run: | cilium hubble port-forward& - sleep 5s + sleep 10s + [[ $(pgrep -f "cilium hubble port-forward|kubectl port-forward.*hubble-relay" | wc -l) == 2 ]] - name: Run connectivity test run: | diff --git a/.github/workflows/kind.yaml b/.github/workflows/kind.yaml index 4f99a453f6..de33d48319 100644 --- a/.github/workflows/kind.yaml +++ b/.github/workflows/kind.yaml @@ -60,7 +60,8 @@ jobs: - name: Relay Port Forward run: | cilium hubble port-forward& - sleep 5s + sleep 10s + [[ $(pgrep -f "cilium hubble port-forward|kubectl port-forward.*hubble-relay" | wc -l) == 2 ]] - name: Connectivity Test run: | @@ -87,7 +88,8 @@ jobs: pkill -f "cilium hubble port-forward|kubectl port-forward.*hubble-relay" sleep 1s cilium hubble port-forward& - sleep 5s + sleep 10s + [[ $(pgrep -f "cilium hubble port-forward|kubectl port-forward.*hubble-relay" | wc -l) == 2 ]] - name: Connectivity test run: |