Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(minikube): accept local IPv6 context endpoints

Alfredo Lopez2f6381302631
diff --git a/scripts/minikube/t2-common.sh b/scripts/minikube/t2-common.sh
index 58fe01d9a..41f8754c1 100755
--- a/scripts/minikube/t2-common.sh
+++ b/scripts/minikube/t2-common.sh
@@ -228,10 +228,15 @@ t2_context_check() {
fi
host="${endpoint#*://}"
host="${host%%/*}"
- host="${host%%:*}"
+ if [[ "$host" == \[*\]* ]]; then
+ host="${host#\[}"
+ host="${host%%\]*}"
+ else
+ host="${host%%:*}"
+ fi
host="$(printf '%s' "$host" | tr '[:upper:]' '[:lower:]')"
case "$host" in
- 127.0.0.1|192.168.*|*.minikube) ;;
+ 127.0.0.1|localhost|::1|192.168.*|*.minikube) ;;
*)
T2_NEXT_COMMAND='select the generated branch-owned Minikube context, not a remote cluster context'
t2_fail DEVELOPMENT_SCOPE_REQUIRED "Kubernetes context endpoint is not local: $host"
diff --git a/scripts/tests/test-minikube-t2-scenarios.sh b/scripts/tests/test-minikube-t2-scenarios.sh
index ae8497b6b..2b3783341 100755
--- a/scripts/tests/test-minikube-t2-scenarios.sh
+++ b/scripts/tests/test-minikube-t2-scenarios.sh
@@ -104,6 +104,10 @@ expect_code DEVELOPMENT_SCOPE_REQUIRED remote-context remote-context \
bash -c 'source "$1"; t2_context_check' bash "$COMMON"
env "${repo_env[@]}" PATH="$fake_bin:$PATH" FAKE_ENDPOINT=127.0.0.1 \
bash -c 'source "$1"; t2_context_check' bash "$COMMON"
+env "${repo_env[@]}" PATH="$fake_bin:$PATH" FAKE_ENDPOINT='[::1]' \
+ bash -c 'source "$1"; t2_context_check' bash "$COMMON"
+env "${repo_env[@]}" PATH="$fake_bin:$PATH" FAKE_ENDPOINT=localhost \
+ bash -c 'source "$1"; t2_context_check' bash "$COMMON"
missing_profile_state="$(env "${repo_env[@]}" bash -c 'source "$1"; t2_mk(){ printf "%s" "Profile not found"; }; t2_profile_status; printf "%s" "$T2_PLAN_STATE"' bash "$COMMON")"
[ "$missing_profile_state" = full-bootstrap ] || fail "missing profile selected $missing_profile_state instead of full-bootstrap"