pub const HELM_CHART_KEY_API_VERSION: &str = "apiVersion";Expand description
Canonical Helm 3 Chart.yaml top-level YAML axis-key naming the
per-chart chart-schema-apiVersion field whose scalar-value
HELM_CHART_API_VERSION already owns as the peer axis-value
lift. Where the peer axis-value lift pins the byte-shape of the
apiVersion: field’s admitted scalar (Helm 3’s "v2"), this
axis-key lift pins the byte-shape of the apiVersion: field’s
YAML-key name itself: the load-bearing serde-rename literal at
caixa-helm’s ChartYaml struct
(caixa-helm/src/lib.rs:145, #[serde(rename = "apiVersion")])
that selects how the Rust field api_version serializes into
the rendered Chart.yaml YAML mapping.
The byte-shape ("apiVersion") is byte-identical to the K8s-CR
top-level per-CR schema-apiVersion axis key (KUBE_KEY_API_VERSION)
by Helm’s design decision to inherit the K8s CR top-level shape
verbatim (see chart-yaml-desc) — the paired
helm_chart_key_api_version_matches_kube_key_api_version pin
asserts the two byte-shapes coincide, so a future K8s-side
rebrand at KUBE_KEY_API_VERSION that dropped the byte-
identity would fail the pin, surfacing the axis divergence at
substrate-build time rather than as a silent Helm-chart-schema-
parser rejection at helm lint / helm template time. The two
axes are structurally-independent schema surfaces (the Helm 3
chart-schema top-level shape vs. the K8s apiserver-side CR
top-level shape) whose byte-shapes happen to coincide today; the
paired pin makes the coincidence load-bearing rather than
accidental.
The single source of truth every consumer that names the per- Chart.yaml top-level chart-schema-apiVersion YAML key reaches for:
caixa-helm’sChartYamlstruct’sapi_versionfield#[serde(rename = "apiVersion")]attribute (the sole production serialize-side site the literal appears at as a syntactic serde-rename argument; the attribute itself cannot consume aconstbecause Rust’s attribute grammar admits only string literals, so the discipline here is: the const’s byte-shape must remain byte-identical to the literal the attribute pins, and the paired drift-detection pin at [caixa-helm]’schart_yaml_serializes_api_version_axis_under_lifted_helm_chart_key_api_versionround-trips a rendered [caixa-helm]-emittedChart.yamlthroughserde_yaml::from_str::<serde_yaml::Value>and asserts the top-levelMapping::get(HELM_CHART_KEY_API_VERSION)resolves — closing the drift the syntactic-literal-only attribute would otherwise leave silent);- every test-side navigator that inspects the serialized
[
caixa-helm]-emittedChart.yamlYAML mapping by the top- level chart-schema-apiVersion key.
A drift on the emitter’s serde-rename literal (a future refactor
that dropped the #[serde(rename = "apiVersion")] attribute or
changed the target key to "ApiVersion" / "apiversion" /
"schemaVersion") would silently serialize the field under
Rust’s default snake_case api_version: key, which Helm’s
chart-schema parser rejects at helm lint / helm dependency build / helm template time with an “apiVersion is required”
error — the failure surfaces far from the drift site, and every
downstream lareira-<nome> chart consumer drops with no field
naming the serde-rename-drift root cause. Same drift-detection-
pin discipline the peer HELM_CHART_KEY_TYPE /
HELM_CHART_KEY_APP_VERSION lifts (d29bc23) established on the
sibling per-Chart.yaml serde-rename-literal-only axis pair —
extends the discipline from the two axes those lifts closed onto
the third and last serde-rename-literal-only axis at
[caixa-helm]’s ChartYaml struct, so every #[serde(rename = "...")] literal on the struct threads through a canonical
substrate-side &'static str with a paired drift-detection pin.