Skip to main content

fanout_child_name_for

Function fanout_child_name_for 

Source
pub fn fanout_child_name_for(
    base: &str,
    policy_ns: &str,
    member: Option<(&str, &str)>,
    repo: Option<&RepositoryRef>,
) -> String
Expand description

The deterministic child Snapshot name for one (source-member, repository) cell of a fan-out — the general form behind fanout_child_name.

  • member: Some((pvc_ns, pvc_name)) for a selector-expanded member, None for a policy whose single source needs no per-PVC expansion.
  • repo: Some(ref) for a multi-repository fan-out child, None for the classic single-repo shapes.

The four combinations produce:

memberreponame
NoneNone<base> — the legacy non-fanned name, byte-identical
SomeNone<base>-pvc-<pslug>-<h8> — byte-identical to the legacy fanout_child_name
NoneSome<base>-repo-<rslug>-<h8>
SomeSome<base>-pvc-<pslug>-repo-<rslug>-<h8>

<h8> is FNV-1a over the newline-framed FULL unclipped tuple — base, then (when present) "<pvc_ns>/<pvc_name>", then (when present) the normalized repo_key — so clipping any legible segment never merges two distinct cells, and a policy slug that happens to contain -repo- (pslug x-repo-y vs pslug x + rslug y) still yields distinct names because the hash inputs differ. Markers and the tag are NEVER clipped; when over budget the clip order is base → pslug → rslug. Always ≤ [MAX_CHILD_NAME] (63).

The legacy hash input for repo: None is exactly the pre-multi-repo "{base}\n{pvc_ns}/{pvc_name}" — pinned by golden tests.