Skip to content

Add remote.Puller#1644

Merged
jonjohnsonjr merged 1 commit intogoogle:mainfrom
jonjohnsonjr:pagination
Apr 20, 2023
Merged

Add remote.Puller#1644
jonjohnsonjr merged 1 commit intogoogle:mainfrom
jonjohnsonjr:pagination

Conversation

@jonjohnsonjr
Copy link
Copy Markdown
Collaborator

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

@jonjohnsonjr jonjohnsonjr requested a review from imjasonh April 11, 2023 18:46
@codecov-commenter
Copy link
Copy Markdown

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
)

type catalog struct {
type Catalogs struct {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why plural?

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

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
Copy Markdown
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.

3 participants