Commit 95deede
authored
egress: stop Helm clobbering serge's runtime allowlist additions (#53)
## Problem
The `serge-egress` tinyproxy filter is a single `.data.filter` string
written by **two** parties:
- **Helm** seeds the base allowlist
(`taskExecution.kubernetes.egress.allowDomains`: GitHub + the HF LLM
router).
- **serge** patches the same ConfigMap at runtime to add configured LLM
provider hosts — `reviewbot/k8s_sandbox.py:sync_egress_allowlist`, which
is additive and non-destructive (reads the current filter, appends only
missing hosts).
Under **server-side apply** the two managers can't share ownership of
one atomic string. The next `helm upgrade` re-applies the base-only
value onto serge's augmented value and fails:
```
UPGRADE FAILED: conflict occurred while applying object serge/serge-egress /v1, Kind=ConfigMap:
Apply failed with 1 conflict: conflict with "OpenAPI-Generator" using v1: .data.filter
```
This blocks **every** serge deploy once serge has added a provider host
live (e.g. `api.anthropic.com`, `api.openai.com`).
## Fix (chart-only)
Render `.data.filter` as the **union of the live filter (read via
`lookup`) and the declared base domains**:
- Helm still **guarantees the base allowlist is always present**
(appends any base domain that's missing).
- Helm **re-emits serge's runtime additions verbatim**, so its applied
value equals the live value in steady state → **no SSA conflict**.
- No serge code change, no image rebuild.
### Caveat
`lookup` returns nothing under `helm template` / `--dry-run` (no cluster
read), so a **dry-run renders only the base domains**. The real `helm
upgrade` reads the live filter and preserves serge's additions. This is
documented in a comment in the template.
## Testing
- `helm template … --show-only templates/egress-proxy.yaml` → renders
the base 3 domains, no errors (expected: `lookup` empty under
`template`).1 parent bb3d598 commit 95deede
1 file changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
45 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
46 | 74 | | |
47 | 75 | | |
48 | 76 | | |
| |||
0 commit comments