Skip to main content

cache_pvc_name

Function cache_pvc_name 

Source
pub fn cache_pvc_name(
    policy_name: &str,
    policy_ns: &str,
    repo: Option<&RepositoryRef>,
) -> String
Expand description

The kopia-cache PVC name for one (policy, repository) cell.

A kopia client cache is REPOSITORY-SPECIFIC state (indexes, metadata, owned blobs of ONE repository), and the mover mounts it at a fixed KOPIA_CACHE_DIRECTORY — so a multi-repo policy’s children must not share one PVC or they poison each other’s cache. Hence:

  • repo: None — the classic single-repo cache: kopiur-cache-<policy>, byte-identical to the pre-multi-repo name (including its historical lack of a length cap — an existing PVC must keep matching by name).
  • repo: Some(_) — a pinned child of a multi-repo policy: kopiur-cache-<policy>-<rslug>-<h6>, where <h6> is 6 hex of FNV-1a over the normalized repo_key (never clipped — the injectivity guarantee, same family as fanout_child_name_for) and the whole name is capped at 63 (RFC 1123 label, the same Job-label bound child names honor). Clip order: policy slug first, then rslug; marker dashes and the tag never.

Ownership stays the policy in both shapes (the caller’s concern).