Skip to content

Agent Mesh

ci: show canaries with zero available replicas as 0/N in the health report

Antonio Ojea62858bc3cc31
diff --git a/.github/workflows/testnet-health.yaml b/.github/workflows/testnet-health.yaml
index 10532b3f..c02f1e83 100644
--- a/.github/workflows/testnet-health.yaml
+++ b/.github/workflows/testnet-health.yaml
@@ -110,11 +110,13 @@ jobs:
unhealthy=""
total=0
- while read -r name ready want; do
+ # availableReplicas is absent when it is 0, so the fields are
+ # separated explicitly rather than by whitespace.
+ while IFS='|' read -r name ready want; do
[[ -z "${name}" ]] && continue
total=$((total + 1))
[[ "${ready:-0}" == "${want}" ]] || unhealthy="${unhealthy} ${name}(${ready:-0}/${want})"
- done < <(kubectl get deployments -n "${CNS}" -o jsonpath='{range .items[*]}{.metadata.name} {.status.availableReplicas} {.spec.replicas}{"\n"}{end}' 2>/dev/null)
+ done < <(kubectl get deployments -n "${CNS}" -o jsonpath='{range .items[*]}{.metadata.name}|{.status.availableReplicas}|{.spec.replicas}{"\n"}{end}' 2>/dev/null)
if [[ "${total}" -gt 0 && -z "${unhealthy}" ]]; then
ok "Canaries" "${total} deployments fully available"
else