@@ -623,3 +623,71 @@ tasks:
623623 TMP_DIR : " {{ .TMP_DIR }}"
624624 NESTED_KUBECONFIG : " {{ .NESTED_KUBECONFIG }}"
625625 SDS_SC_NAME : " {{ .SDS_SC_NAME }}"
626+ ci:kubeconfig:ensure :
627+ desc : Ensure nested kubeconfig exists at the expected path
628+ vars :
629+ RUN_ID : ' {{ .RUN_ID | default (env "RUN_ID") | default "" }}'
630+ WORKSPACE :
631+ sh : git rev-parse --show-toplevel 2>/dev/null || pwd
632+ cmds :
633+ - |
634+ set -euo pipefail
635+ RUN_ID="{{ .RUN_ID }}"
636+ if [ -z "$RUN_ID" ]; then
637+ echo "[ERR] RUN_ID must be provided to locate nested kubeconfig" >&2
638+ exit 1
639+ fi
640+ WORKSPACE="${GITHUB_WORKSPACE:-{{ .WORKSPACE }}}"
641+ TARGET_PATH="$WORKSPACE/ci/dvp-e2e/tmp/runs/$RUN_ID/nested/kubeconfig"
642+ if [ ! -s "$TARGET_PATH" ]; then
643+ echo "[ERR] Nested kubeconfig not found at $TARGET_PATH" >&2
644+ exit 1
645+ fi
646+ echo "[INFO] Using nested kubeconfig at $TARGET_PATH"
647+ [ -n "${GITHUB_ENV:-}" ] && echo "KUBECONFIG=$TARGET_PATH" >> "$GITHUB_ENV"
648+ ci:manual-wait :
649+ desc : Pause execution to allow manual SSH inspection of nested cluster
650+ vars :
651+ RUN_ID : ' {{ .RUN_ID | default (env "RUN_ID") | default "" }}'
652+ WORKSPACE :
653+ sh : git rev-parse --show-toplevel 2>/dev/null || pwd
654+ WAIT_SECONDS : ' {{ .WAIT_SECONDS | default (env "MANUAL_WAIT_SECONDS") | default "7200" }}'
655+ cmds :
656+ - |
657+ set -euo pipefail
658+ RUN_ID="{{ .RUN_ID }}"
659+ WAIT="{{ .WAIT_SECONDS }}"
660+ if [ -z "$RUN_ID" ]; then
661+ echo "[ERR] RUN_ID must be set for ci:manual-wait" >&2
662+ exit 1
663+ fi
664+ if ! [[ "$WAIT" =~ ^[0-9]+$ ]]; then
665+ echo "[ERR] WAIT_SECONDS must be numeric (got '$WAIT')" >&2
666+ exit 1
667+ fi
668+ if [ "$WAIT" -le 0 ]; then
669+ echo "[INFO] Manual wait skipped (WAIT_SECONDS=$WAIT)"
670+ exit 0
671+ fi
672+ WORKSPACE='{{ .WORKSPACE }}'
673+ PARENT_KUBECONFIG="$WORKSPACE/ci/dvp-e2e/tmp/runs/$RUN_ID/parent.kubeconfig"
674+ echo "[INFO] Pausing for $WAIT seconds before running tests."
675+ echo "[INFO] Use parent kubeconfig for SSH tunneling:"
676+ echo " export KUBECONFIG=$PARENT_KUBECONFIG"
677+ echo " d8 v ssh --namespace $RUN_ID --username ubuntu <vm-name>"
678+ echo "[INFO] Press Ctrl+C in the workflow run to cancel wait early."
679+ START_TS=$(date +%s)
680+ END=$((START_TS + WAIT))
681+ LAST_NOTE=$START_TS
682+ while true; do
683+ NOW=$(date +%s)
684+ [ "$NOW" -ge "$END" ] && break
685+ REM=$((END - NOW))
686+ printf '[INFO] Manual wait: %d seconds remaining...\n' "$REM"
687+ if [ $((NOW - LAST_NOTE)) -ge 300 ]; then
688+ echo "[INFO] Cluster should be ready for manual SSH troubleshooting."
689+ LAST_NOTE=$NOW
690+ fi
691+ sleep 60 || true
692+ done
693+ echo "[INFO] Manual wait finished; proceeding to tests."
0 commit comments