Skip to main content

collect_and_validate_targets

Function collect_and_validate_targets 

Source
pub fn collect_and_validate_targets(
    reloaders: &HashMap<String, ReloaderConfig>,
) -> Result<Vec<Target>, CopyError>
Expand description

Collects mirror targets from all reloaders, merges targets for the same pod, and validates that there are no conflicts. Returns a deduplicated, sorted list of targets ready for use with Manager::prepare_copies.

Validation rules:

  • The same container may not appear in more than one reloader for the same pod.
  • A pod-level target (no container specified) cannot be combined with a container-level target for the same pod.

§Errors

Returns CopyError::DuplicateContainer or CopyError::MixedPodAndContainerTargets (wrapped in CopyError::ValidatingTarget) if a reloader’s target conflicts with another’s.