Skip to main content

flux_kustomization_source_subtree

Function flux_kustomization_source_subtree 

Source
pub fn flux_kustomization_source_subtree(cluster: &str, nome: &str) -> String
Expand description

Canonical substrate-side per-cluster / per-caixa Kustomization.spec.path source-sub-tree scalar composer — the ./clusters/<cluster>/services/<nome> GitRepository-relative directory-tree seed every caixa-flux-emitted kustomization.yaml document mounts under its lifted FLUX_KUSTOMIZATION_KEY_PATH leaf-scalar-key at the top-level spec position so the Flux v2 kustomize-controller’s per-CR reconcile loop walks into the paired per-cluster / per-caixa sub-tree of the pleme-io k8s repository (rather than the GitRepository root, which would pull every unrelated cluster’s manifests through the wrong per-caixa Kustomization).

The rendered string is the substrate’s contract with the pleme-io k8s repository’s canonical directory-tree layout: every per-caixa Servico’s rendered manifests live at pleme-io/k8s/clusters/<cluster>/services/<nome>/, so the Flux v2 kustomize-controller-side per-CR reconcile loop keys off the same GitRepository-relative sub-tree seed by construction — the composer output is the exact spec.path scalar the substrate seeds into every emitted per-caixa kustomization.yaml document under its top- level spec position.

Composes two axes:

  • the per-cluster prefix — the ./clusters/<cluster>/ half of the sub-tree seed that scopes the emit to the paired cluster’s manifest set (so two clusters hosting the same per-caixa Servico — rio vs paris — land at distinct spec.path scalars with no cross-cluster reconcile drift at the kustomize-controller’s per-CR apply loop);
  • the per-caixa suffix — the /services/<nome> half of the sub-tree seed that scopes the emit to the paired per-caixa Servico’s manifest sub-directory under the cluster’s services/ directory (so two per-caixa Servicos co-resident under the same cluster — hello-rio vs cart — land at distinct spec.path scalars with no per-caixa reconcile drift at the same kustomize-controller apply loop).

Peer to cilium_network_policy_name / gateway_api_http_route_name / oci_chart_ref / lareira_chart_name on the sibling substrate- side canonical-composer-of-a-canonical-scalar-that-consumers-key-off axis: every writer-side helper composes a canonical load-bearing scalar the substrate contracts with a downstream consumer’s index (Cilium’s per-CNP metadata.name, Gateway API’s per-HTTPRoute metadata.name, Helm’s OCI-artifact ref, Helm’s Chart.yaml name: axis). This composer’s Kustomization.spec.path peer names the Flux v2 kustomize-controller-side per-CR reconcile-target sub-tree index — same “the load-bearing multi-axis composition lives in one place” discipline extended from the mesh renderer’s per-CR-identity-scalar axes onto the flux renderer’s per-CR-source-sub-tree axis.

Until this lift landed the two-axis composition sat as a verbatim inline format!("./clusters/{cluster}/services/{name}") template at the sole cluster_bundle kustomization.yaml format-string production emit site plus a mirror-symmetric verbatim inline format!("./clusters/{cluster}/services/{name}", …) at the paired cluster_bundle_kustomization_path_pins_lifted_sub_tree test-fixture navigation site — the substrate’s canonical per-cluster / per-caixa sub-tree seed had no compile-time link between the two sites. A future substrate-side directory-tree axis rebrand (clusters/environments/ for a multi-env-per-cluster axis extension, services/servicos/ for a portuguese-canonical directory-name migration matching the sibling :servicos slot spelling, a per-tenant scoping prefix for multi-tenant Aplicacao hosting) would have had to be threaded through both sites in lockstep or the two would silently split: the production emit would key off the drifted encoding while the test pin still asserts the original. Lifting closes the drift footgun ahead of the second production-emit occurrence the M4 mesh.pleme.io/v1alpha1/Aplicacao CR materializer’s per-Aplicacao Kustomization synthesis will surface — the second consumer inherits the canonical per-cluster / per-caixa sub-tree composition by construction without opportunity for per-renderer drift.

The PRIME DIRECTIVE duplication-budget rule (THEORY.md §I.3.5) lifts the composition in advance of the second occurrence the M4 materializer will surface, so the second consumer inherits the canonical sub-tree seed by construction.