Skip to content
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 remote.Puller #1644

Merged
merged 1 commit into from
Apr 20, 2023
Merged

Add remote.Puller #1644

merged 1 commit into from
Apr 20, 2023

Conversation

jonjohnsonjr
Copy link
Collaborator

This PR adds a Puller implementation and uses it in crane ls and crane catalog to stream results for each page.

@codecov-commenter
Copy link

codecov-commenter commented Apr 11, 2023

Codecov Report

Merging #1644 (f9faf99) into main (ed5c185) will decrease coverage by 0.04%.
The diff coverage is 70.94%.

❗ Current head f9faf99 differs from pull request most recent head a1568b4. Consider uploading reports for the commit a1568b4 to get more accurate results

@@            Coverage Diff             @@
##             main    #1644      +/-   ##
==========================================
- Coverage   72.07%   72.03%   -0.04%     
==========================================
  Files         120      121       +1     
  Lines        9772     9860      +88     
==========================================
+ Hits         7043     7103      +60     
- Misses       2010     2033      +23     
- Partials      719      724       +5     
Impacted Files Coverage Δ
pkg/v1/remote/list.go 68.83% <63.41%> (-5.53%) ⬇️
pkg/v1/remote/catalog.go 59.55% <70.45%> (+1.48%) ⬆️
pkg/v1/remote/puller.go 73.33% <73.33%> (ø)
pkg/v1/remote/descriptor.go 73.94% <100.00%> (+0.22%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jonjohnsonjr jonjohnsonjr force-pushed the pagination branch 2 times, most recently from f9faf99 to a1568b4 Compare April 11, 2023 19:55
@@ -25,8 +25,9 @@ import (
"github.com/google/go-containerregistry/pkg/v1/remote/transport"
)

type catalog struct {
type Catalogs struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why plural?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

remote.Catalog is already defined 😅

Comment on lines 113 to 111
func (f *fetcher) head(ctx context.Context, ref name.Reference) (*v1.Descriptor, error) {
return f.headManifest(ctx, ref, allManifestMediaTypes)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This method doesn't add much, can we just have callers pass allManifestMediaTypes themselves?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

This PR adds a Puller implementation and uses it in `crane ls` and
`crane catalog` to stream results for each page.
@jonjohnsonjr jonjohnsonjr merged commit 07c767c into google:main Apr 20, 2023
@jonjohnsonjr jonjohnsonjr deleted the pagination branch April 20, 2023 17:53
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.

None yet

3 participants