Conversation
Make the function public Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Extract the function to iterate over available pull endpoints for the given image reference. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Use the distribution code to query the remote repository for tags and pull them sequentially just like the non-c8d pull. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
|
Just one comment before I read the code, it's nice to have 3 independent commits but if I read only the first commit message I have no idea what is going in, it's missing a "why", at least an explanation for our future selves. I've been digging a lot into the history lately and pretty much the majority of the messages on commits like these say "this is doing this and that", but none say "we want it like this because..." |
| func (p *puller) pull(ctx context.Context, ref reference.Named) (err error) { | ||
| // TODO(tiborvass): was ReceiveTimeout | ||
| p.repo, err = newRepository(ctx, p.repoInfo, p.endpoint, p.config.MetaHeaders, p.config.AuthConfig, "pull") | ||
| p.repo, err = NewRepository(ctx, p.repoInfo, p.endpoint, p.config.MetaHeaders, p.config.AuthConfig, "pull") |
There was a problem hiding this comment.
I need to have a closer look at the changes, but wanted to leave a "global" comment; the code in the distribution package is "not great". There's a lot of complexity involved, and some weird constructs (having to create objects just to know "is this for docker hub, or another registry"). I know I tried to un-export as much as possible for that reason.
I guess my comment here is; if we can avoid exposing more, we should (perhaps internal if there's currently no other way, which would buy us time to work on better implementations)
There was a problem hiding this comment.
I tried to avoid exposing too much, but I don't think we can unexpose more here. We can't even move it to internal, because we would need to reference private things from distribution, which we would need to make public anyway.
There was a problem hiding this comment.
Alternatively, I could make a function like distribution.GetAllTags(registry.Service) ([]string, error) so we'd avoid exposing NewRepository and PullEndpoints.
distribution: Export NewRepository
Make the function public
distribution: Extract PullEndpoints from Pull
Extract the function to iterate over available pull endpoints for the
given image reference.
c8d/pull: Handle pull all tags
Use the distribution code to query the remote repository for tags and
pull them sequentially just like the non-c8d pull.
Note: This uses the distribution code to query the remote registry for available tags. Theoretically these endpoints could be a little bit different than what the containerd pull would use as we don't pass these (and have no ability to do so) to the containerd pull.
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)