Skip to content
This repository was archived by the owner on Nov 19, 2026. It is now read-only.

Reset SystemContext.DockerAuthConfig when using mirrors at different registries - #625

Merged
mtrmac merged 1 commit into
containers:masterfrom
mtrmac:mirror-no-credentials
May 13, 2019
Merged

mtrmac merged 1 commit into
containers:masterfrom
mtrmac:mirror-no-credentials

Conversation

@mtrmac

@mtrmac mtrmac commented May 11, 2019

Copy link
Copy Markdown
Collaborator

This was brought up sometime during the reviews, but was apparently lost.

Consider registries.conf:

[[registry]]
location = "example.com"
mirror = [
	{ location = "docker.io" },
	{ location = "registry.access.redhat.com" },
	{ location = "registry.redhat.io" },
	{ location = "registry.fedoraproject.org" },
]

Then

skopeo --registries-conf registries.conf copy --src-creds foo:bar docker://example.com/foo/bar dir:t

currently sends the foo:bar to every mirror that requires authentication, not just to example.com; that seems clearly undesirable.

So, clear SystemContext.DockerAuthConfig when using a mirror at a different registry than the one specified by the user; if the mirrors require credentials, they have to be set up in the auth file, e.g. by podman login.

@vrothberg @saschagrunert PTAL.

(#588 may be relevant for more discussion about DockerAuthConfig)

@saschagrunert

saschagrunert commented May 13, 2019 •

Copy link
Copy Markdown
Member

LGTM, but the CI seems to need a rebump. Maybe a test case in skopeo or a unit test here would be good to add.

@vrothberg

Copy link
Copy Markdown
Member

LGTM. I opened #627 to make CI pass again. ubuntu:artful (i.e., 17:10) hit EOL.

…registries

.. so that we don't send credentials intended for the primary endpoint to mirrors.

Signed-off-by: Miloslav Trmač <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants