You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+93Lines changed: 93 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,6 +161,52 @@ make tools.asdf-install
161
161
-`8.7` and older use separate component template directories.
162
162
- Never assume paths/components are identical across versions.
163
163
164
+
### Template Gating Patterns
165
+
Many template blocks are gated behind value flags that create implicit coupling:
166
+
167
+
-**`global.elasticsearch.external`** gates ES auth env var injection in most components (8.7 and 8.8). A hard constraint in `constraints.tpl` blocks setting `external=true` when the bundled subchart is active (`elasticsearch.enabled=true`). To inject auth when using the bundled subchart, use component-level `env` overrides instead.
168
+
-**`global.elasticsearch.tls.existingSecret`** triggers TLS truststore volume mounts and `JAVA_TOOL_OPTIONS` injection in most components. This is NOT behind the `external` gate — it works with the bundled subchart.
169
+
- Template blocks often differ between versions (e.g., 8.7 Operate init container renders `operate.env` with `toYaml` but NOT `tpl`, so `{{ .Release.Name }}` in `valueFrom.secretKeyRef.name` is literal). Always read the specific version's template before writing env overrides.
170
+
171
+
### Helm Subchart Value Override Patterns
172
+
Helm's values merge is a **deep merge for maps** but a **full replace for arrays**. This matters for subchart overrides:
173
+
174
+
```yaml
175
+
# Parent chart values.yaml default:
176
+
elasticsearch:
177
+
master:
178
+
extraEnvVars: # <-- array
179
+
- name: SOME_VAR
180
+
value: "default"
181
+
182
+
# Your overlay:
183
+
elasticsearch:
184
+
master:
185
+
extraEnvVars: [] # Replaces the entire array — parent default is gone
186
+
```
187
+
188
+
This is the correct way to neutralize a parent chart's default array value. Setting `extraEnvVars: []` removes the parent's entries entirely. Setting `extraEnvVars: [{name: SOME_VAR, value: "override"}]` replaces the array with your single entry.
189
+
190
+
**Contrast with deploy-camunda's merge:** The `deploy-camunda` CLI uses name-keyed deep merge for `env` arrays (matching on `name` field). But Helm itself does NOT — Helm replaces arrays wholesale. Know which merge strategy applies at each layer.
191
+
192
+
### Bitnami Subchart Env Var Chains
193
+
Bitnami charts often set env vars from multiple sources in a fixed order within the statefulset template:
When Kubernetes encounters duplicate env var names, **the last one wins**. If the parent chart's `values.yaml` defaults an `extraEnvVars` entry that conflicts with a security helper value, you must either override or clear the array. To diagnose:
200
+
201
+
```bash
202
+
# Render and count occurrences of a suspicious env var:
4. Run single package/test first, then chart-scoped test run.
183
229
5. Update golden files only for intentional rendering changes.
184
230
6. Record discoveries and remaining work in `STATE.md`.
231
+
232
+
## Adding New Persistence Layers and Scenarios
233
+
234
+
### New Persistence Layer
235
+
A persistence layer is a values file at `charts/<version>/test/integration/scenarios/chart-full-setup/values/persistence/<name>.yaml`. To add one:
236
+
237
+
1. Create the YAML file with the values needed for the data backend.
238
+
2. Add the name to `validPersistence` in `scripts/camunda-core/pkg/scenarios/scenarios.go`.
239
+
3. Update help text and shell completions in `scripts/deploy-camunda/cmd/prepare_values.go` and `scripts/deploy-camunda/cmd/root.go`.
240
+
241
+
### New CI Test Scenario
242
+
Scenarios are defined in `charts/<version>/test/ci-test-config.yaml`. Each entry specifies identity, persistence, platforms, flows, and optional features. Example:
243
+
244
+
```yaml
245
+
- name: elasticsearch-self-signed-upgrade
246
+
enabled: false # set true when ready for CI
247
+
identity: keycloak
248
+
persistence: elasticsearch-self-signed
249
+
platforms: [gke]
250
+
flows: [upgrade-minor]
251
+
features: [migrator] # includes values/features/migrator.yaml
252
+
shortname: esss # 4-char, used in namespace generation
253
+
```
254
+
255
+
The `features` array maps to `values/features/<name>.yaml`. The `migrator` feature enables identity and data migration jobs during upgrades — use it for any `upgrade-minor` scenario. Note: the automatic `needsMigrator()` function in `scenarios.go` only activates when `ChartVersion` starts with "13", but the matrix runner does not set `ChartVersion`, so always use `features: [migrator]` explicitly.
256
+
257
+
### Pre-Install Hooks (Scenario-Specific)
258
+
When a scenario needs prerequisites in the namespace before `helm install` (e.g., TLS secrets), use a pre-install script:
For cleanup needed between Step 1 (old version) and Step 2 (new version) of an upgrade flow, use `pre-upgrade-minor.sh` in the target version's `pre-setup-scripts/`. Common needs for 8.7→8.8:
275
+
- Delete identity deployment (port naming conflict: 8.7 uses `containerPort: 8080`, 8.8 uses `8084`, both named `http` — Kubernetes strategic merge patch keeps both, causing a duplicate name error).
276
+
- Delete stale 8.7 ingresses that route to non-existent services.
277
+
- Delete PostgreSQL statefulsets (Bitnami version changes).
0 commit comments