Skip to main content

repository_ref_for

Function repository_ref_for 

Source
pub fn repository_ref_for(snap: &Snapshot) -> Option<RepositoryRef>
Expand description

Derive the repository a Snapshot belongs to, in fixed precedence order:

  1. status.resolved.repository — the run-time pin every produced snapshot records (controller-written, authoritative);
  2. spec.repository — the mint-time pin a multi-repo policy fan-out child or a SnapshotReplication copy CR carries (present before any status has been written, and the only pin such a CR is guaranteed to have);
  3. the Repository/ClusterRepository controller ownerReference a discovered snapshot carries (it has neither block).

Pure. Shared by the Restore reconciler (spec.repository derivation for snapshotRef) and the kubectl kopiur browse data-plane, so the derivation rule cannot fork.