Change Review



**minikube_setup.sh**
– The change from `eval $(minikube docker-env)` → `eval $(minikube docker-env)` is correct.
– However, using **quoted command substitution** is safer, so `eval “$(minikube docker-env)”` is recommended.
– Optionally, adding `set -euo pipefail` will make the script more robust.

**reset-env.sh**
– The comment header has been updated to match the actual filename — 👍 good consistency improvement.

**scripts/pfwd.sh**
– Adding `wait` at the end now keeps the script running in the foreground.
This behavior is fine if the terminal running the PF process is intended to remain open (a short note in the documentation would be helpful).
– The API port-forward is still **hardcoded to 8081** — it’s better to align with the previous approach and use the variable `API_LOCAL_PORT` for consistency.


Minimal Follow-up Patch (ready to apply)

1) Harden minikube_setup.sh

diff --git a/minikube_setup.sh b/minikube_setup.sh
index 1111111..2222222 100755
--- a/minikube_setup.sh
+++ b/minikube_setup.sh
@@ -1,10 +1,12 @@
 #!/bin/bash
 # Script: minikube-setup.sh
 # Purpose: Start Minikube with Docker driver and enable ingress
+set -euo pipefail
 
 # Start Minikube
 minikube start --driver=docker
-eval $(minikube docker-env)
+eval "$(minikube docker-env)"
 
 # Enable the Ingress addon
 minikube addons enable ingress
 
 echo "✅ Minikube started with Ingress enabled"

2) Unify API Port in scripts/pfwd.sh

diff --git a/scripts/pfwd.sh b/scripts/pfwd.sh
index 3333333..4444444 100755
--- a/scripts/pfwd.sh
+++ b/scripts/pfwd.sh
@@ -4,6 +4,7 @@ NS_INFRA=portal-dev
 NS_DEV=portal-dev
 
 # ===== 設定 =====
+API_LOCAL_PORT=${API_LOCAL_PORT:-8081}
 NS=${NS:-portal-dev}
 # Docker Desktop / pgAdmin 等から届くよう既定は 0.0.0.0
 PF_ADDR=${PF_ADDR:-0.0.0.0}
@@ -11,10 +12,10 @@ PF_ADDR=${PF_ADDR:-0.0.0.0}
 # 既定ポート
 PG_LOCAL_PORT=${PG_LOCAL_PORT:-15432}    # -> svc/postgres:5432
-API_LOCAL_PORT=${API_LOCAL_PORT:-8080}   # -> svc/portal-api:80
 CHROMA_LOCAL_PORT=${CHROMA_LOCAL_PORT:-18000} # -> svc/chroma:8000
 
 # Direct service forwards (optional)
 kubectl -n $NS_INFRA port-forward svc/postgres 15432:5432 &
-kubectl -n $NS_DEV   port-forward svc/portal-api 8081:80 &
+kubectl -n $NS_DEV   port-forward svc/portal-api ${API_LOCAL_PORT}:80 &
 kubectl -n $NS_DEV   port-forward svc/odoo 8082:80 &
 kubectl -n $NS_INFRA port-forward svc/chroma 18000:8000 &
 
+# keep the script attached; Ctrl-C to stop all port-forwards
 wait

Also, add the following note to docs/local-repro.md:

Note:
pfwd.sh runs in the foreground, so keep this terminal window open while it’s active.
Press Ctrl-C to stop all port-forwards when you’re done.


Comments

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です