@intentius/chant-lexicon-helm 0.0.24 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/integrity.json +6 -4
- package/dist/manifest.json +1 -1
- package/dist/rules/values-no-helm-tpl.ts +92 -0
- package/dist/rules/whm005-no-empty-wrapper.ts +54 -0
- package/dist/skills/chant-helm-patterns.md +52 -0
- package/dist/skills/chant-helm.md +71 -22
- package/package.json +6 -3
- package/src/codegen/docs.ts +3 -2
- package/src/index.ts +4 -1
- package/src/intrinsics.ts +53 -0
- package/src/lint/post-synth/post-synth.test.ts +43 -0
- package/src/lint/post-synth/whm005-no-empty-wrapper.ts +54 -0
- package/src/lint/rules/lint-rules.test.ts +35 -0
- package/src/lint/rules/values-no-helm-tpl.ts +92 -0
- package/src/plugin.test.ts +4 -2
- package/src/resources.ts +20 -0
- package/src/serializer.test.ts +113 -2
- package/src/serializer.ts +149 -13
- package/src/skills/chant-helm-patterns.md +52 -0
- package/src/skills/chant-helm.md +71 -22
package/src/skills/chant-helm.md
CHANGED
|
@@ -65,6 +65,53 @@ import { If, values } from "@intentius/chant-lexicon-helm";
|
|
|
65
65
|
export const ingress = If(values.ingress.enabled, new Ingress({ ... }));
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
+
### Runtime values and value overrides
|
|
69
|
+
|
|
70
|
+
Use `runtimeSlot()` for deploy-time values that cannot be known at build time (database IPs, bucket names, etc.):
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import { Values, runtimeSlot } from "@intentius/chant-lexicon-helm";
|
|
74
|
+
|
|
75
|
+
export const vals = new Values({
|
|
76
|
+
global: {
|
|
77
|
+
psql: {
|
|
78
|
+
host: runtimeSlot("Cloud SQL private IP"), // → '' in values.yaml
|
|
79
|
+
},
|
|
80
|
+
redis: {
|
|
81
|
+
host: runtimeSlot("Memorystore persistent host"),
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`runtimeSlot()` generates two outputs:
|
|
88
|
+
- `values.yaml` — the field emits `''` (empty placeholder, safe for `helm template`)
|
|
89
|
+
- `values-runtime-slots.yaml` — lists only the slots with descriptions as YAML comments, for use as a deploy-time checklist
|
|
90
|
+
|
|
91
|
+
**WHM004** fires when `v.xxx` (the values proxy) is used inside `new Values({...})` — values.yaml is not a Go template, so `{{ .Values.x }}` would silently become `''`. Use `runtimeSlot()` instead.
|
|
92
|
+
|
|
93
|
+
Use `ValuesOverride` for static configuration shared across all deployments, like disabling bundled services:
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { ValuesOverride } from "@intentius/chant-lexicon-helm";
|
|
97
|
+
|
|
98
|
+
export const baseOverride = new ValuesOverride({
|
|
99
|
+
filename: "values-base", // → generates chart-dir/values-base.yaml
|
|
100
|
+
values: {
|
|
101
|
+
postgresql: { install: false },
|
|
102
|
+
redis: { install: false },
|
|
103
|
+
certmanager: { install: false },
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Pass the generated file at deploy time:
|
|
109
|
+
```bash
|
|
110
|
+
helm upgrade --install my-release chart/
|
|
111
|
+
-f chart/values-base.yaml # generated by ValuesOverride
|
|
112
|
+
-f values-prod.yaml # runtime overrides (from values-runtime-slots.yaml)
|
|
113
|
+
```
|
|
114
|
+
|
|
68
115
|
### Built-in objects
|
|
69
116
|
|
|
70
117
|
```typescript
|
|
@@ -218,28 +265,30 @@ const lifecycle = HelmCRDLifecycle({
|
|
|
218
265
|
|
|
219
266
|
## Lint rules
|
|
220
267
|
|
|
221
|
-
| Rule | Description |
|
|
222
|
-
|
|
223
|
-
| WHM001 | Chart must have name, version, apiVersion |
|
|
224
|
-
| WHM002 | Values should not contain bare secrets |
|
|
225
|
-
| WHM003 | Container images should use values references |
|
|
226
|
-
|
|
|
227
|
-
|
|
|
228
|
-
|
|
|
229
|
-
|
|
|
230
|
-
|
|
|
231
|
-
|
|
|
232
|
-
|
|
|
233
|
-
|
|
|
234
|
-
|
|
|
235
|
-
|
|
|
236
|
-
|
|
|
237
|
-
|
|
|
238
|
-
|
|
|
239
|
-
|
|
|
240
|
-
|
|
|
241
|
-
|
|
|
242
|
-
|
|
|
268
|
+
| Rule | Phase | Description |
|
|
269
|
+
|------|-------|-------------|
|
|
270
|
+
| WHM001 | pre-synth | Chart must have name, version, apiVersion |
|
|
271
|
+
| WHM002 | pre-synth | Values should not contain bare secrets |
|
|
272
|
+
| WHM003 | pre-synth | Container images should use values references |
|
|
273
|
+
| WHM004 | pre-synth | HelmTpl (`v.xxx`) has no effect in Values — use `runtimeSlot()` |
|
|
274
|
+
| WHM005 | post-synth | Chart with dependencies but no templates — deploy upstream chart directly |
|
|
275
|
+
| WHM101 | post-synth | Chart.yaml has valid apiVersion (v2) |
|
|
276
|
+
| WHM102 | post-synth | values.schema.json present when Values used |
|
|
277
|
+
| WHM103 | post-synth | Go template syntax valid (balanced braces) |
|
|
278
|
+
| WHM104 | post-synth | NOTES.txt exists for application charts |
|
|
279
|
+
| WHM105 | post-synth | _helpers.tpl exists |
|
|
280
|
+
| WHM201 | post-synth | Resources have standard Helm labels |
|
|
281
|
+
| WHM301 | post-synth | At least one test for application charts |
|
|
282
|
+
| WHM302 | post-synth | Resource limits set |
|
|
283
|
+
| WHM401 | post-synth | Image uses :latest tag or no tag |
|
|
284
|
+
| WHM402 | post-synth | runAsNonRoot not set |
|
|
285
|
+
| WHM403 | post-synth | readOnlyRootFilesystem not set |
|
|
286
|
+
| WHM404 | post-synth | privileged: true detected |
|
|
287
|
+
| WHM405 | post-synth | Resource spec missing cpu/memory |
|
|
288
|
+
| WHM406 | post-synth | CRD lifecycle limitation |
|
|
289
|
+
| WHM407 | post-synth | Secret with inline data |
|
|
290
|
+
| WHM501 | post-synth | Unused values keys |
|
|
291
|
+
| WHM502 | post-synth | Deprecated K8s API versions |
|
|
243
292
|
|
|
244
293
|
## OCI registry workflow
|
|
245
294
|
|