Skip to main content

validate_restore

Function validate_restore 

Source
pub fn validate_restore(spec: &RestoreSpec) -> ValidationResult
Expand description

A Restore spec is internally consistent (ADR §3.6/§4.6).

The externally-tagged RestoreSource/RestoreTarget enums already guarantee exactly one variant — that is a compile-time/serde invariant, not re-checked here. We validate the cross-field rules the enums can’t express:

  • source.identity requires spec.repository (nothing else can derive it).
  • if target: pvc, the template must name the PVC (name non-empty).