Commit 0935927
committed
Fix CI bootstrap: defer mandatory kubeconfig load until after setup
The earlier safety-ordering commit broke CI: BuildConfigFromFlags was
called BEFORE setupMultiTenant, but in CI the kubeconfig file is
created BY setupMultiTenant (via kind-cluster-reset). Cold runs hit
"stat /tmp/duckgres-kind-kubeconfig: no such file or directory" before
the test bodies could run.
Split the guard into two phases:
Phase 1 (pre-setup, mandatory env-var check + conditional file check):
- Always require DUCKGRES_K8S_TEST_KUBECONFIG to be set
- If the file already exists (warm local rerun), validate it via
requireLocalKindCluster BEFORE setupMultiTenant runs. This is
what would have stopped the mw-dev incident in the
env-pointed-at-real-cluster variant.
- If the file doesn't exist yet (cold CI), skip the file load.
setupMultiTenant's opening `kubectl delete namespace` runs
against the missing path and fails inert ("no such file") — no
damage possible because kubectl can't connect.
Phase 2 (post-setup, mandatory):
- File MUST exist now; load + requireLocalKindCluster. Final
safety net for the cold-bootstrap path. Failure aborts before
any test body runs.
The env-unset path (the actual mw-dev incident shape) still fail-fasts
in <1s with the existing REFUSING message, verified locally.1 parent 0ed8924 commit 0935927
1 file changed
Lines changed: 38 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
98 | 116 | | |
99 | 117 | | |
100 | 118 | | |
| |||
107 | 125 | | |
108 | 126 | | |
109 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
110 | 142 | | |
111 | 143 | | |
112 | 144 | | |
| |||
0 commit comments