Skip to content

Add ReportResolvedSourceReference to copy.Options#2967

Closed
justinmir wants to merge 1 commit intocontainers:mainfrom
justinmir:add-resolved-source-reference
Closed

Add ReportResolvedSourceReference to copy.Options#2967
justinmir wants to merge 1 commit intocontainers:mainfrom
justinmir:add-resolved-source-reference

Conversation

@justinmir
Copy link

When registry mirrors are configured via registries.conf, callers of copy.Image() have no way to discover which endpoint was actually contacted. The dockerImageSource already tracks this internally in its physicalRef field, but that information is never surfaced.

Introduce a types.ResolvedImageSource optional interface that transports can implement to report the actual endpoint used. The docker transport implements it by returning physicalRef. copy.Image() detects the interface and writes the resolved reference into the new ReportResolvedSourceReference field on Options, following the same pointer-based pattern as the existing ReportResolvedReference for destinations.

This enables consumers like CRI-O to expose the resolved registry domain in image pull metrics, giving operators visibility into which mirror or cache endpoint is serving their pulls.

When registry mirrors are configured via registries.conf, callers
of copy.Image() have no way to discover which endpoint was actually
contacted. The dockerImageSource already tracks this internally in
its physicalRef field, but that information is never surfaced.

Introduce a types.ResolvedImageSource optional interface that
transports can implement to report the actual endpoint used. The
docker transport implements it by returning physicalRef. copy.Image()
detects the interface and writes the resolved reference into the new
ReportResolvedSourceReference field on Options, following the same
pointer-based pattern as the existing ReportResolvedReference for
destinations.

This enables consumers like CRI-O to expose the resolved registry
domain in image pull metrics, giving operators visibility into which
mirror or cache endpoint is serving their pulls.
@github-actions
Copy link

This repository has been migrated to https://github.com/containers/container-libs. Please open your PR there.

@github-actions github-actions bot closed this Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant