Skip to content

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

TypeScript

fix(minikube): defer GFS credential reconciliation until migration

Alfredo Lopezb5764e80ecd6
diff --git a/scripts/minikube/pre-gate-sync.sh b/scripts/minikube/pre-gate-sync.sh
index bbad658bb..8615b9fff 100755
--- a/scripts/minikube/pre-gate-sync.sh
+++ b/scripts/minikube/pre-gate-sync.sh
@@ -459,12 +459,13 @@ if [[ "${cluster_changed}" == "true" ]]; then
CONTEXT="${PROFILE}" bash "${PROJECT_DIR}/deploy/scripts/apply-gfs-writer-secret.sh"
writer_dsn="$(${KC} -n gfs get secret gfs-controller-db -o 'jsonpath={.data.connection-string}')"
if [[ -n "${writer_dsn}" ]]; then
- if ! ${KC} -n control-plane rollout status deployment/control-api --timeout=5s >/dev/null 2>&1; then
- log "ERROR: existing GFS writer detected but control-api is not Ready; refusing full overlay sync"
- exit 1
- fi
- log "Upgrade path — reconciling GFS credentials before full overlay sync"
- CONTEXT="${PROFILE}" bash "${PROJECT_DIR}/deploy/scripts/reconcile-gfs-deploy-credentials.sh"
+ # Do not reconcile the GFS roles before the migration window. The
+ # current control-api image may add a new least-privilege projection
+ # (0095 currently adds lifecycle/link columns); provision-gfs-db.sh
+ # correctly refuses a role that does not have that projection yet. The
+ # post-migration provision_gfs_serving call below is the authoritative
+ # reconciliation point after schema and runtime roles have converged.
+ log "Upgrade path — deferring GFS credential reconciliation until after schema migration"
else
log "Fresh bootstrap — reader staging deferred until post-migration convergence; GFSC remains fail-closed"
fi
diff --git a/scripts/tests/test-minikube-pre-gate-sync-state.sh b/scripts/tests/test-minikube-pre-gate-sync-state.sh
index f29cb73d4..a6bea52dd 100755
--- a/scripts/tests/test-minikube-pre-gate-sync-state.sh
+++ b/scripts/tests/test-minikube-pre-gate-sync-state.sh
@@ -159,6 +159,16 @@ else
fail "pre-gate sync can run the GFS authentication probe while control-api is fenced"
fi
+cluster_sync_line="$(grep -nF 'if [[ "${cluster_changed}" == "true" ]]; then' "$SCRIPT" | head -n 1 | cut -d: -f1)"
+pre_migration_reconcile_line="$(awk -v start="$cluster_sync_line" -v end="$control_api_migration_line" \
+ 'NR >= start && NR < end && /reconcile-gfs-deploy-credentials\.sh/ { print NR; exit }' "$SCRIPT")"
+if [[ -z "$pre_migration_reconcile_line" && -n "$gfs_provision_line" && \
+ -n "$control_api_migration_line" && "$control_api_migration_line" -lt "$gfs_provision_line" ]]; then
+ pass "pre-gate defers GFS credential reconciliation until after schema migration"
+else
+ fail "pre-gate can reconcile GFS roles before the migration that grants their projection"
+fi
+
if contains 'fence_control_api()' &&
contains 'restore_control_api()' &&
contains 'fence_workflow_reconciler' &&