Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix: ignore terminating gateway pods in pre-gate guard
Alfredo Lopez1fe7f389d1d0
diff --git a/scripts/minikube/pre-gate-runtime.sh b/scripts/minikube/pre-gate-runtime.shindex 360fc9d0f..5c34091fc 100755--- a/scripts/minikube/pre-gate-runtime.sh+++ b/scripts/minikube/pre-gate-runtime.sh@@ -66,23 +66,36 @@ rollout_namespace_deployments() {assert_workflow_gateway_prompt_bridge_finalization_route() {local deployment="nginx-workflow-approval-gateway"local namespace="control-plane"- local pod+ local candidate deletion ready pod_count=0if ! ${KC} get deployment "${deployment}" -n "${namespace}" >/dev/null 2>&1; thenlog "ERROR: ${namespace}/${deployment} is absent; refusing Plugin Workload SDK gate"return 1fi- pod="$(${KC} get pods -n "${namespace}" -l app="${deployment}" \- --field-selector=status.phase=Running -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || true)"- if [[ -z "${pod}" ]]; then- log "ERROR: ${namespace}/${deployment} has no Running pod; refusing Plugin Workload SDK gate"- return 1- fi+ # A rollout can leave an old pod in Running/Terminating briefly. Do not+ # inspect the first pod returned by the API: that made the previous guard+ # race a healthy new ReplicaSet and reject a valid deployment. Only inspect+ # Ready, non-terminating pods, and require the route in every active pod.+ while IFS= read -r candidate; do+ [[ -z "${candidate}" ]] && continue+ deletion="$(${KC} get pod "${candidate}" -n "${namespace}" \+ -o jsonpath='{.metadata.deletionTimestamp}' 2>/dev/null || true)"+ [[ -n "${deletion}" ]] && continue+ ready="$(${KC} get pod "${candidate}" -n "${namespace}" \+ -o jsonpath='{.status.containerStatuses[?(@.name=="nginx")].ready}' 2>/dev/null || true)"+ [[ "${ready}" == "true" ]] || continue+ pod_count=$((pod_count + 1))+ if ! ${KC} exec -n "${namespace}" "${candidate}" -c nginx -- nginx -T 2>&1 | \+ grep -Fq 'location ~ ^/api/v1/mcp-host/plugin-workload-sdk/invocations/[^/]+/finalize$'; then+ log "ERROR: active ${namespace}/${candidate} does not serve the SDK finalization route; refusing gate"+ return 1+ fi+ done < <(${KC} get pods -n "${namespace}" -l app="${deployment}" \+ --field-selector=status.phase=Running -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' 2>/dev/null || true)- if ! ${KC} exec -n "${namespace}" "${pod}" -c nginx -- nginx -T 2>&1 | \- grep -Fq 'location ~ ^/api/v1/mcp-host/plugin-workload-sdk/invocations/[^/]+/finalize$'; then- log "ERROR: running ${namespace}/${deployment} does not serve the SDK finalization route; refusing gate"+ if [[ "${pod_count}" == "0" ]]; then+ log "ERROR: ${namespace}/${deployment} has no Ready non-terminating pod; refusing Plugin Workload SDK gate"return 1filog "Workflow gateway serves the SDK promptBridge finalization route"diff --git a/scripts/minikube/pre-gate-sync.sh b/scripts/minikube/pre-gate-sync.shindex 0c68d69c1..31790983e 100755--- a/scripts/minikube/pre-gate-sync.sh+++ b/scripts/minikube/pre-gate-sync.sh@@ -390,6 +390,7 @@ elselog "No cluster sync required before ${GATE_NAME}"assert_no_legacy_prompt_bridge_grantsensure_evenfire_registry+ rollout_if_present control-plane nginx-workflow-approval-gatewayassert_workflow_gateway_prompt_bridge_finalization_route${KC} get deploy -A --no-headers 2>/dev/null | grep -v kube-system || truefi