Skip to main content

image_ref_candidates

Function image_ref_candidates 

Source
pub fn image_ref_candidates(image: &str) -> Vec<(String, String)>
Expand description

Candidate (name, reference) spellings for the LITERAL image string, in priority order, for cross-spelling lookups in a local store.

This is pure string work — it NEVER canonicalizes the reference or invents a registry host. It exists so a store that extracted an image under one spelling (e.g. docker.io/library/alpine:latest) can still be found when the user later asks for an equivalent spelling (alpine:latest) WITHOUT rewriting the storage key to a canonical form. The reference (tag or digest body) is split off once and shared across every candidate.

Order (first match wins; duplicates removed):

  1. The primary name as given.
  2. With docker.io/ prefix stripped.
  3. With docker.io/library/ prefix stripped.
  4. With library/ prefix stripped.
  5. With library/ prefix added (only when the primary name has no /).
  6. The bare last path segment.