Skip to content

Commit f5316c5

Browse files
committed
docs(helm): say null must be applied in every layer that sets a key
`null` deletes a key from the map it is applied to, not from the pod. A key set in both `app.env` and `app.envDefaults` survives a null on the app.env entry alone — the deployment then inlines the envDefaults value again. Under ESO a retained `externalSecrets.remoteRefs.app` mapping keeps syncing the key regardless of app.env. - README and self-hosting docs: drop the "works in all three secret modes" shorthand and spell out that every layer setting the key must be nulled, including the ESO remote mapping - tests: cover both halves — nulling only app.env restores the envDefault, nulling both actually removes the key - chart 1.5.4; staging took 1.5.3 in the meantime
1 parent e49c356 commit f5316c5

4 files changed

Lines changed: 36 additions & 3 deletions

File tree

apps/docs/content/docs/en/platform/self-hosting/environment-variables.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ app:
260260
FREE_TABLE_ROWS_LIMIT: null
261261
```
262262
263-
Setting the variable to an empty string does **not** remove it: the chart reads an empty value as "not specified", so the inherited value still applies. Confirm what the pod will actually receive before rolling out:
263+
Setting the variable to an empty string does **not** remove it: the chart reads an empty value as "not specified", so the inherited value still applies.
264+
265+
Null the variable in every layer that sets it. If it appears in both `app.env` and `app.envDefaults`, nulling only the `app.env` entry lets the `envDefaults` value apply again and the limit stays in force. With External Secrets, also drop the key from `externalSecrets.remoteRefs.app`, which keeps syncing it independently. Confirm what the pod will actually receive before rolling out:
264266

265267
```bash
266268
helm template sim ./helm/sim -f values.yaml | grep -A1 FREE_TABLE # expect no output

helm/sim/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: sim
33
description: A Helm chart for Sim - the open-source AI workspace where teams build, deploy, and manage AI agents
44
type: application
5-
version: 1.5.3
5+
version: 1.5.4
66
appVersion: "v0.7.44"
77
kubeVersion: ">=1.25.0-0"
88
home: https://sim.ai

helm/sim/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,9 @@ app:
374374
FREE_TABLE_ROWS_LIMIT: null
375375
```
376376

377-
Or on the CLI: `--set app.envDefaults.FREE_TABLES_LIMIT=null`. This works for `app.env` and `realtime.env` too, and in all three secret modes.
377+
Or on the CLI: `--set app.envDefaults.FREE_TABLES_LIMIT=null`.
378+
379+
**Null the key in every layer that sets it.** `null` deletes the key from the map you null, not from the pod — so if a key is set in both `app.env` and `app.envDefaults`, nulling only the `app.env` entry makes the inline `envDefaults` value apply again and the variable stays on the pod. The same holds for `realtime.env` / `realtime.envDefaults`. Under ESO there is a third source: a key mapped in `externalSecrets.remoteRefs.app` keeps being synced into the Secret regardless of `app.env`, so remove that mapping too. Rendering the manifest (below) is the reliable way to confirm the key is actually gone.
378380

379381
**Setting the key to `""` instead does not remove it.** Every key under `app.env` in `values.yaml` ships as a `""` placeholder, so the templates have to treat an empty string as "the operator said nothing" — if they did not, the ten placeholders that collide with a real `app.envDefaults` value (`NEXT_PUBLIC_APP_URL`, `BETTER_AUTH_URL`, `NEXT_PUBLIC_BRAND_NAME`, `VERTEX_LOCATION`, `EMAIL_VERIFICATION_ENABLED`, …) would blank themselves out on every default install. An empty entry is a silent no-op; `null` is the deletion.
380382

helm/sim/tests/env-null-deletion_test.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,35 @@ tests:
101101
name: BILLING_CONCURRENCY_LIMIT_FREE
102102
value: "10"
103103

104+
- it: nulling only app.env lets a matching envDefaults value apply again
105+
template: deployment-app.yaml
106+
values:
107+
- values/preset-free-limits.yaml
108+
set:
109+
<<: *defaults
110+
app.env.FREE_TABLES_LIMIT: null
111+
asserts:
112+
- contains:
113+
path: spec.template.spec.containers[0].env
114+
content:
115+
name: FREE_TABLES_LIMIT
116+
value: "3"
117+
118+
- it: nulling both layers is what actually removes the key
119+
template: deployment-app.yaml
120+
values:
121+
- values/preset-free-limits.yaml
122+
- values/unset-free-limits.yaml
123+
set:
124+
<<: *defaults
125+
app.env.FREE_TABLES_LIMIT: null
126+
asserts:
127+
- notContains:
128+
path: spec.template.spec.containers[0].env
129+
content:
130+
name: FREE_TABLES_LIMIT
131+
value: "3"
132+
104133
- it: nulling a boot-critical key is still refused by the existing validator
105134
values:
106135
- values/preset-free-limits.yaml

0 commit comments

Comments
 (0)