Skip to content

Conversation

manishtomar
Copy link
Contributor

@manishtomar manishtomar commented Oct 30, 2018

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

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
Copy link

codecov bot commented Oct 30, 2018

Codecov Report

Merging #2748 into master will increase coverage by 0.04%.
The diff coverage is 72.41%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#linux 60.33% <72.41%> (+0.04%) ⬆️
Impacted Files Coverage Δ
registry/storage/tagstore.go 70.67% <72.41%> (+0.48%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 93e0827...1251e51. Read the comment docs.

@manishtomar manishtomar requested a review from dmcgowan October 30, 2018 05:35
}

dgstsSet := make(map[digest.Digest]bool)
for i := 0; i < 3; i++ {
Copy link
Collaborator

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
Copy link
Collaborator

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.

Copy link
Contributor Author

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>
@manishtomar
Copy link
Contributor Author

@dmcgowan I've updated the name and tests. PTAL

@manishtomar
Copy link
Contributor Author

@dmcgowan Could you take a look and merge if possible? This will help in unblocking some vendoring issues internally.

Copy link
Collaborator

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

@manishtomar
Copy link
Contributor Author

@dmcgowan Thanks for the approval. Could you please merge it? I don't have merge access yet. Wouldn't mind getting it :)

@caervs caervs merged commit ae2e973 into distribution:master Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants