Skip to main content

FLUX_KEY_SOURCE_REF

Constant FLUX_KEY_SOURCE_REF 

Source
pub const FLUX_KEY_SOURCE_REF: &str = "sourceRef";
Expand description

Canonical Flux v2 per-HelmRelease/Kustomization source-reference container-axis key every caixa-flux-emitted bundle document mounts its per-CR source-of-truth pointer under (spec.chart.spec.sourceRef on HelmRelease, spec.sourceRef on Kustomization) — the Flux v2 CRD schema places the (kind, name, namespace) reference triple under this single container key, so drift on the container axis is exactly as load-bearing as drift on the sibling FLUX_KIND_GIT_REPOSITORY (dbbcf29) kind-discriminator + DEFAULT_FLUX_SYSTEM_NAMESPACE (7197d38) namespace axes the block nests (a "source_ref" / "source" / "sourceReference" / "gitSourceRef" typo at either the emit-side format-string template or a downstream test-fixture probe silently dangles the HelmRelease.spec.chart.spec.sourceRef chart resolution + the Kustomization.spec.sourceRef source resolution at the Flux v2 source-controller’s CRD registration; the source-controller’s per-CR reconcile loop keys off this exact container axis to source the (kind, name, namespace) reference triple, and a drift silently freezes the dependent per-Servico dependsOn chain at apply time with no field naming the sourceRef-container-drift root cause).

The single source of truth the rendered Flux bundle’s per-CR source-reference-container-axis-naming reaches for:

  • the rendered helmrelease.yaml document’s per-HelmRelease spec.chart.spec.sourceRef block (caixa-flux/src/lib.rs — the cluster_bundle helmrelease format-string template’s {source_ref_key}:\n sub-block header, now threaded through the lifted const via a {source_ref_key} named-arg interpolation);
  • the rendered kustomization.yaml document’s per-Kustomization spec.sourceRef block (caixa-flux/src/lib.rs — the sibling cluster_bundle kustomization format-string template’s {source_ref_key}:\n sub-block header, now threaded through the lifted const via the sibling {source_ref_key} named-arg interpolation);
  • five test-side navigation sites in mod tests that probe the rendered documents’ .get("sourceRef") container axis to pin the emitted (kind, name, namespace) reference triple against the sibling lifted FLUX_KIND_GIT_REPOSITORY + DEFAULT_FLUX_SYSTEM_NAMESPACE axes.

The container-axis key names the same Flux-v2-source-controller-side per-CR source-of-truth reference-triple container as the sibling per-CRD kind discriminator FLUX_KIND_GIT_REPOSITORY nests inside, and must move together on any future Flux v3 rebrand (a hypothetical upstream Flux v3 rename of the source-reference container axis from sourceRef to source / sourceReference / sourceOf, coordinated with the upstream fluxcd/flux2 project’s per-version deprecation cycle, would land at this one const rather than scattered across the two per-CR format-string templates + five per-test-fixture probe sites).

The PRIME DIRECTIVE duplication-budget rule (THEORY.md §I.3.5, “every recurring shape becomes a generator before it becomes a pattern; every pattern becomes a library before it becomes duplicated code. The duplication budget is zero.”) promotes the constant to a typed substrate-side &'static str on the same trajectory the FLUX_KIND_GIT_REPOSITORY (dbbcf29) / FLUX_KIND_HELM_RELEASE (e24ea3c) / FLUX_KIND_KUSTOMIZATION (2d61a6f) / FLUX_HELMRELEASE_API_VERSION (55f0fd9) / FLUX_GITREPOSITORY_API_VERSION (8a6c8a3) / FLUX_KUSTOMIZATION_API_VERSION (d2dd1b1) / DEFAULT_FLUX_SYSTEM_NAMESPACE (7197d38) lifts established on the sibling canonical-Flux-v2-load-bearing-string surfaces — extends the per-CRD kind-discriminator + apiVersion + install-namespace lift trajectory onto the sibling per-CR source-reference container-axis key the cluster_bundle HelmRelease + Kustomization renderers both consume under their nested (kind, name, namespace) reference triple.