Skip to content

httpreader: random access over an HTTP resource#1953

Open
hdonnay wants to merge 2 commits into
quay:mainfrom
hdonnay:hack/httpreader
Open

httpreader: random access over an HTTP resource#1953
hdonnay wants to merge 2 commits into
quay:mainfrom
hdonnay:hack/httpreader

Conversation

@hdonnay

@hdonnay hdonnay commented Jul 17, 2026

Copy link
Copy Markdown
Member

This adds a package (internal/httpreader) that implements io.ReaderAt over HTTP requests. It incorporates a lot of tricks I know from a past life dealing with RFC7233 non- and selectively- compliant servers.

Then, the fetcher package gains the capability to use an httpreader.Reader when it notices that a layer is uncompressed.

Future work may involve the tarfs layer doing transparent caching and being able to handle compressed layers directly.

@hdonnay
hdonnay requested review from a team as code owners July 17, 2026 18:41
@hdonnay
hdonnay requested a review from crozzy July 17, 2026 18:41
@hdonnay

hdonnay commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Conflicts with #1948

hdonnay added 2 commits July 17, 2026 14:16
This package does an io.ReaderAt over an HTTP resource. It includes a
novel way to determine the end of a resource for partially-compliant
servers. Using wholly-compliant servers is recommended.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Change-Id: I08d6671217535ac897a2ed5c9cd20aa06a6a6964
This handles the "easy" case of simply proxying reads for uncompressed
tar archives to range requests.

Future improvements would move the "spooling" out of this package and
into the `fs.FS` implementation.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
Change-Id: I9d200dd841954054df0b187b9fd160a56a6a6964
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant