diff --git a/examples/kind/README.md b/examples/kind/README.md index c13ed563..820e119c 100644 --- a/examples/kind/README.md +++ b/examples/kind/README.md @@ -69,7 +69,8 @@ The script will: 3. Create a kind cluster with OIDC configuration 4. Deploy zot with OIDC authentication enabled 5. Configure RBAC for OIDC users -6. Wait for user input before cleanup +6. In interactive mode: Wait for user input before cleanup + In non-interactive mode: Automatically cleanup after validation #### OIDC Configuration Details diff --git a/examples/kind/kind-oidc.sh b/examples/kind/kind-oidc.sh index 8648e028..293d908f 100755 --- a/examples/kind/kind-oidc.sh +++ b/examples/kind/kind-oidc.sh @@ -88,15 +88,22 @@ docker run -d --name dex-server \ # Wait for Dex to start echo "Waiting for Dex to be ready..." +DEX_READY=false for i in $(seq 1 30); do if docker exec dex-server wget -qO- --no-check-certificate https://localhost:10443/dex/.well-known/openid-configuration > /dev/null 2>&1; then echo "Dex is ready" + DEX_READY=true break fi echo "Waiting for Dex... ($i/30)" sleep 2 done +if [ "$DEX_READY" = false ]; then + echo "ERROR: Dex failed to become ready within timeout" + exit 1 +fi + # create registry container unless it already exists reg_name='kind-registry' reg_port='5001'