Skip to main content

effective_source

Function effective_source 

Source
pub fn effective_source(
    policy: &SnapshotPolicy,
    pin: Option<&SnapshotSourceRef>,
) -> Result<EffectiveSource, ValidationError>
Expand description

Resolve which source this Snapshot covers.

  • pin: None — the ordinary single-source case: sources[0] governs, and its own pvc/nfs is the target. Byte-for-byte the old behavior.
  • pin: Some(_) — a fanned-out child: sourceIndex selects the governing source’s knobs, and the pinned target is the concrete PVC.

An out-of-range sourceIndex (the policy shrank mid-run) is a named, terminal error. It is emphatically NOT a fallback to sources[0]: silently backing up a different volume than the one the CR names is the worst possible failure mode for a backup operator.