Skip to content

Default the auth config domain to the target image domain#46779

Merged
thaJeztah merged 1 commit intomoby:masterfrom
dmcgowan:c8d-default-auth-domain
Nov 7, 2023
Merged

Default the auth config domain to the target image domain#46779
thaJeztah merged 1 commit intomoby:masterfrom
dmcgowan:c8d-default-auth-domain

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

@dmcgowan dmcgowan commented Nov 7, 2023

When server address is not provided with the auth configuration, use the domain from the image provided with the auth.

Alternative to #46745 without support for sending a single auth config to multiple hosts. This is similar to containerd's default handlers. To support multi-host authorization in the future, we can use the transfer service API or define a credential callback.

When server address is not provided with the auth configuration,
use the domain from the image provided with the auth.

Signed-off-by: Derek McGowan <[email protected]>
@thaJeztah thaJeztah added status/2-code-review kind/bugfix PR's that fix bugs containerd-integration Issues and PRs related to containerd integration labels Nov 7, 2023
@thaJeztah thaJeztah added this to the 25.0.0 milestone Nov 7, 2023
@thaJeztah thaJeztah added the area/distribution Image Distribution label Nov 7, 2023
@thaJeztah
Copy link
Copy Markdown
Member

FWIW; we were discussing this Yesterday, and considered that this approach was less ambiguous than treating ServerAddress as a wildcard; some blurbs of the discussion;

  • Using ServerAddress == "" as a wildcard can be a potential footgun; there's many place where we consider "no registry means default registry (Docker Hub)"
  • For the existing functionality (docker push always pushing a single image), ambiguity is limited, but with work in progress on the containerd integration, it's possible that docker push may support multiple images in future (see Suggestion: Add source image option to docker push #38880), in which case things become more ambiguous.
  • We also discussed putting the logic of this PR in the API (if we receive credentials without a ServerAddress, then fill in the address on the first possible occasion), however this would (likely / potentially) break registry mirrors.
  • We should (in a follow-up) add proper documentation for the ServerAddress field, and describe what it's used for (and where). Part of the ambiguity is due to (IIRC) the same field being used on the client-side and daemon side, but for slightly different purposes.
  • Long term, we want to look at adopting an authentication flow similar to BuildKit (which uses GRPC to request authentication from the client); [discuss] client auth protocol for push/pull #38591

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah
Copy link
Copy Markdown
Member

@rumpl @laurazard PTAL

Copy link
Copy Markdown
Member

@rumpl rumpl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah marked this pull request as ready for review November 7, 2023 15:44
@thaJeztah
Copy link
Copy Markdown
Member

I think we should be ok merging it. It’s master / v25 and containerd, so if there’s issues we overlooked, we can still fix those later, so I moved this out of draft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/distribution Image Distribution containerd-integration Issues and PRs related to containerd integration kind/bugfix PR's that fix bugs status/2-code-review

Projects

Development

Successfully merging this pull request may close these issues.

c8d: ImagePush ignores provided RegistryAuth

3 participants