c8d/pull: Handle pull all tags (2nd approach)#46618
Merged
thaJeztah merged 2 commits intomoby:masterfrom Oct 31, 2023
Merged
Conversation
Add a function to return tags for the given repository reference. This is needed to implement the `pull -a` (pull all tags) for containerd which doesn't directly use distribution, but we need to somehow make an API call to the registry to obtain the available tags. 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>
133df0a to
d9b5445
Compare
rumpl
reviewed
Oct 25, 2023
rumpl
reviewed
Oct 25, 2023
rumpl
approved these changes
Oct 30, 2023
thaJeztah
approved these changes
Oct 31, 2023
Comment on lines
+33
to
+34
| // Tags returns available tags for the given image in the remote repository. | ||
| func Tags(ctx context.Context, ref reference.Named, config *Config) ([]string, error) { |
Member
There was a problem hiding this comment.
Was looking if we could move this to an internal package, but that complicates things as well. Perhaps an alternative could be to call it out in the GoDoc as "for internal use", but we can do so in a follow-up if we think that's a good idea.
| return i.pullTag(ctx, tagged, platform, metaHeaders, authConfig, out) | ||
| } | ||
|
|
||
| tags, err := distribution.Tags(ctx, baseRef, &distribution.Config{ |
Member
There was a problem hiding this comment.
For a future iteration, we should consider moving this logic to the API (and either pass a list of tags, or a full list of references to pull)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
distribution: Add Tags
Add a function to return tags for the given repository reference. This
is needed to implement the
pull -a(pull all tags) for containerdwhich doesn't directly use distribution, but we need to somehow make an
API call to the registry to obtain the available tags.
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.
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)