-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add FetchReference() for Repository Target #124
Conversation
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.
Does this have both casss of GET by digest and by tag name?
registry/remote/repository.go
Outdated
@@ -739,6 +796,58 @@ func (s *manifestStore) Resolve(ctx context.Context, reference string) (ocispec. | |||
}, nil | |||
} | |||
|
|||
// FetchTag fetches the content identified by a reference. | |||
// It is equivalent to call `Resolve()` and then `Fetch()` |
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.
This should not be equivalent of resolve and fetch. They are 2 API requests where are this should be only one GET request.
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.
It is equivalent in terms of functionality. We need to mention that it is more efficient as it has only 1 GET request in the documentation.
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.
I would agree but would like to keep the docs for the function without ambiguity. It is clearly 2 APIs and they have different behaviors depending on intermediaries.
Maybe edit to keep it concise and have more details in the example.
//FetchTag fetches the content identified by the reference. The reference may be a tag or digest.
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.
On now thinking more - its sounds incorrect to call this method FetchTag
if we are passing a digest.
We should consider some other name like FetchByReference(string reference....)
.
Or am I missing something here?
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.
Agreed. I've renamed it to FetchReference
and made the doc concise.
The renames look really good. The fact that we are standardizing on ref seems much more consistent. Do you have a test case for this format
|
@sajayantony Test cases added. |
Signed-off-by: Lixia (Sylvia) Lei <lixia_lei@outlook.com>
Signed-off-by: Lixia (Sylvia) Lei <lixia_lei@outlook.com>
Signed-off-by: Sylvia Lei <lixia_lei@outlook.com>
Signed-off-by: Sylvia Lei <lixia_lei@outlook.com>
Signed-off-by: Sylvia Lei <lixia_lei@outlook.com>
@shizhMSFT @sajayantony Could you please review the updates? |
Signed-off-by: Sylvia Lei <lixia_lei@outlook.com>
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
@qweeah will you add an example for this one? |
Closes #122