-
Notifications
You must be signed in to change notification settings - Fork 2.6k
API to retrive tag's digests #2748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add an interface alongside TagStore that provides API to retreive digests of all manifests that a tag historically pointed to. It also includes currently linked tag. Signed-off-by: Manish Tomar <manish.tomar@docker.com>
Codecov Report
@@ Coverage Diff @@
## master #2748 +/- ##
==========================================
+ Coverage 60.28% 60.33% +0.04%
==========================================
Files 103 103
Lines 8003 8032 +29
==========================================
+ Hits 4825 4846 +21
- Misses 2536 2542 +6
- Partials 642 644 +2
Continue to review full report at Codecov.
|
registry/storage/tagstore_test.go
Outdated
} | ||
|
||
dgstsSet := make(map[digest.Digest]bool) | ||
for i := 0; i < 3; i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make this an array of cases with different tags, I think we should make sure that other tags don't also end up in the list.
tags.go
Outdated
@@ -25,3 +27,10 @@ type TagService interface { | |||
// Lookup returns the set of tags referencing the given digest. | |||
Lookup(ctx context.Context, digest Descriptor) ([]string, error) | |||
} | |||
|
|||
// TagIndexes proves method to retreive all the digests that a tag historically pointed to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming nit: why is this called an index? I know that term gets used at the storage level but not sure if it fits here. These could only be created through the manifests endpoints and it kind of a manifest history. Maybe referring to these are manifests rather than indexes would be clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I think indexes is probably not the right term here. I was trying to stick to what is in storage. I think just ManifestDigests
might be better. wdyt?
- use ManifestDigests name instead of Indexes - update tests to validate against multiple tags Signed-off-by: Manish Tomar <manish.tomar@docker.com>
@dmcgowan I've updated the name and tests. PTAL |
@dmcgowan Could you take a look and merge if possible? This will help in unblocking some vendoring issues internally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@dmcgowan Thanks for the approval. Could you please merge it? I don't have merge access yet. Wouldn't mind getting it :) |
Add an interface alongside
TagStore
that provides API to retrieve digests of all manifests that a tag historically pointed to. It also includes currently linked tag. This will not currently be used in distribution but is useful to extract data out from the storage.Signed-off-by: Manish Tomar manish.tomar@docker.com