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 ownpvc/nfsis the target. Byte-for-byte the old behavior.pin: Some(_)— a fanned-out child:sourceIndexselects the governing source’s knobs, and the pinnedtargetis 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.