Template Function Coverage
This page tracks which template functions jhelm implements relative to upstream
Go text/template, Sprig, and Helm, and flags functions that are present but
only partially faithful ("partial") so chart authors know where behaviour may
diverge from Go Helm.
Baseline: the locally installed helm binary used by the comparison test
suite (Helm 3.19 / Sprig as vendored by that release). Verified by enumerating
jhelm’s registered functions and probing each candidate against helm template.
1. Summary
| Group | Status | Notes |
|---|---|---|
Go |
✅ Complete (19 / 19) |
|
Sprig functions |
✅ Complete |
All documented Sprig categories are registered (strings, math, lists, dicts, dates, encoding, crypto, semver, reflection, paths, regex, defaults, type conversion, URL, UUID, network). |
Helm functions |
✅ Complete |
|
2. Genuinely missing
None. toYamlPretty (Helm’s indented-sequence YAML marshaller — block sequence
items indented under their key, ` - x` instead of - x) was the only gap and
has been added.
|
Earlier audits circulated a list of "Helm 4 duration helpers" ( |
3. Partial / verify (present, but behaviour may diverge)
These functions are registered and work, but a JVM reimplementation cannot always reproduce Go’s exact output. Treat output as structurally correct, not byte-identical, unless a parity test exists.
| Function(s) | Caveat |
|---|---|
|
Queries the Kubernetes API. Returns an empty map when no |
|
Returns a stub ( |
|
Performs real DNS resolution; result is environment-dependent and non-deterministic, like Helm. |
|
X.509 / key PEM encoding, serial numbers, and validity defaults can differ from Go’s |
|
Salted / algorithm-specific output. Verify the hash prefix and format match; exact values are non-deterministic. |
|
Round-trips within jhelm, but cross-compatibility with Helm-produced ciphertext depends on identical key derivation and framing. |
|
Masterminds constraint grammar (`^ ~ - x |
>=`, pre-release precedence). Edge cases may differ from the underlying Java semver handling. |
|
|
TOML key ordering, datetime, and nested-table emission vary by library; round-trips and string comparisons are fragile. |
|
Inherently non-deterministic; jhelm’s PRNG does not reproduce Go’s sequence. Only length / charset / format are guaranteed. |
4. jhelm extensions (non-standard)
jhelm registers a few functions that are not in upstream Sprig or Helm. They are harmless convenience aliases, but a chart relying on them is not portable to real Helm:
-
mustHasKey,mustKeys,mustValues,mustPick,mustOmit—must*aliases of the Sprig dict functions (Sprig has only the non-mustforms). -
mustInclude,mustTpl,mustFromYaml,mustFromYamlArray,mustFromJsonArray,mustFromToml—must*aliases not present in Helm. -
kubeVersion— exposed as a function; Helm exposes this via the.Capabilities.KubeVersionobject instead.
5. Known template-engine limitations
Beyond the function map, the most common "it works in Helm but not jhelm" cases are engine/edge-case behaviours rather than missing functions. Known and fixed items (see git history / issues):
-
tplof a string that bothdefine`s and `include`s a template in one string — fixed (defines declared inside `tplcontent are now registered in the shared namespace). -
toYamlof a string containing"inside a sequence item produced\"-escaped output that broke a subsequenttpl(toYaml …)— fixed (sequence items are normalised to plain scalars). -
Large umbrella charts exhausted the heap due to exponential template-alias growth — fixed.
Open / under investigation:
-
Nested
tpl(atplcall whose rendered output contains anothertpl) can still fail to parse on some charts (e.g.grafana/lokiloki.calculatedConfig).