gotenberg: null-safe hardening, probes and resources

Retrofit of #99 for a chart that already carries a values.schema.json,
plus the schema type change that goes with it.

An override written without children is YAML null. Where the chart
defines a default, Helm's coalescing deletes the default before schema
validation runs, so the schema never sees the null and cannot reject it:
the container rendered "securityContext: null" - unhardened, healthy,
silent. Where the chart defines no default (resources.limits), the null
survives into validation and a strict "object" type aborted the render.

The defaultedDict helper from #96 handles the first case; widening the
types of exactly these blocks to ["object", "null"] handles the second.
All other keys stay strict, additionalProperties: false is untouched.

The probes address the container port by name, so a rebuilt default probe
needs no further context.

Rendering with normal values is byte-identical to 5.0.0.
This commit is contained in:
jklein committed 2026-08-23 20:37:12 +02:00
1 parent 1698b6dab8
commit 8bc673d80d
5 files changed
+175 -17

No files matched your search

+11 -9
View File
@@ -43,7 +43,8 @@
},
"definitions": {
"resources": {
"type": "object",
"description": "May be null / empty: the chart then falls back to its default requests and computed limits (issue #99) instead of rendering a container without resource accounting.",
"type": ["object", "null"],
"additionalProperties": false,
"properties": {
"limitFactor": {
@@ -59,7 +60,7 @@
}
},
"resourceList": {
"type": "object",
"type": ["object", "null"],
"additionalProperties": false,
"properties": {
"cpu": {
@@ -118,22 +119,23 @@
}
},
"securityContext": {
"type": "object",
"description": "May be null / empty at any level: the chart then falls back to its hardening defaults (issue #99) instead of rendering an unhardened workload.",
"type": ["object", "null"],
"additionalProperties": false,
"properties": {
"pod": {
"description": "Rendered verbatim as the pod's securityContext; kept open because the chart does not interpret it.",
"type": "object"
"description": "Merged onto the chart's pod hardening defaults and rendered as the pod's securityContext; kept open because the chart does not interpret the individual fields.",
"type": ["object", "null"]
},
"container": {
"description": "Rendered verbatim as the container's securityContext; kept open because the chart does not interpret it.",
"type": "object"
"description": "Merged onto the chart's container hardening defaults and rendered as the container's securityContext; kept open because the chart does not interpret the individual fields.",
"type": ["object", "null"]
}
}
},
"probe": {
"description": "Rendered verbatim as a container probe; kept open because the chart does not interpret it.",
"type": "object"
"description": "Merged onto the chart's probe defaults and rendered as a container probe; kept open because the chart does not interpret the individual fields. May be null / empty, which means the defaults apply (issue #99) rather than the probe disappearing.",
"type": ["object", "null"]
}
}
}