Files
zeekayandHanzo Dev ff7d100496 Everything that calls the control plane calls /v1
The server mounts /v1, /v1/ui and /v2/ui. The UI and its dev proxy, the helm
and kubernetes health probes, functional tests, project templates, examples
and scripts still called /api/v1, so the probes failed and the UI's requests
missed.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-11 04:10:35 -07:00

30 lines
944 B
Bash
Executable File

#!/bin/sh
# wait-for-services.sh - Wait for Hanzo Agents control plane to be ready
set -e
CONTROL_PLANE_URL="${HANZO_AGENTS_SERVER:-http://control-plane:8080}"
HEALTH_ENDPOINT="${CONTROL_PLANE_URL}/v1/health"
# Reduced from 60*2s=120s to 30*1s=30s - control plane typically starts in ~10-15s
MAX_ATTEMPTS="${MAX_ATTEMPTS:-30}"
SLEEP_INTERVAL="${SLEEP_INTERVAL:-1}"
echo "Waiting for Hanzo Agents control plane at ${CONTROL_PLANE_URL}..."
attempt=0
while [ $attempt -lt $MAX_ATTEMPTS ]; do
attempt=$((attempt + 1))
# Try to reach the health endpoint with a simple GET request
if curl --silent --show-error --fail --max-time 2 "${HEALTH_ENDPOINT}" >/dev/null; then
echo "✓ Control plane is ready!"
exit 0
fi
echo "Attempt $attempt/$MAX_ATTEMPTS: Control plane not ready yet..."
sleep $SLEEP_INTERVAL
done
echo "✗ Control plane failed to become ready after $MAX_ATTEMPTS attempts"
exit 1