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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

require a store for buffering #342

Merged
merged 1 commit into from May 13, 2024
Merged

Conversation

joshrwolf
Copy link
Contributor

@joshrwolf joshrwolf commented May 9, 2024

turns out the logs endpoint is:

  1. different than the artifacts endpoint
  2. doesn't support Range 馃槧

in light of that, add store as a required variable for the caller to create, seeing that it must properly be closed as well. this exposes the caller to httpreaderat which I don't love, but its simple to implement and seems worth it for easy conditional buffering

this also changes the return signature to a *zip.Reader, since it appears logs are also returned as zip files

@imjasonh
Copy link
Member

imjasonh commented May 9, 2024

Does httpreaderat just do buffering internally in this case? What do we get from it if we aren't using it to abstract Range?

@joshrwolf
Copy link
Contributor Author

it conditionally buffers to memory (1Mb by default) and file (1Mb<x<1Gb)

@joshrwolf joshrwolf merged commit 34f1ff6 into chainguard-dev:main May 13, 2024
77 checks passed
@joshrwolf
Copy link
Contributor Author

cc @jonjohnsonjr so this atrocity is on your radar. hoping to not need this soon

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

2 participants