oras-project / rust-oci-client

A Rust crate to interact with OCI registries
Apache License 2.0
95 stars 52 forks source link

Fix: Expose HTTP errors when pulling layers #82

Closed jsoverson closed 1 year ago

jsoverson commented 1 year ago

I just ran into an issue exacerbated by a load balancer where the initial pull would succeed, but subsequent layer pulls would fail and return 0-bytes for random layers.

Turns out that using request.byte_stream() (or request.bytes()) will succeed regardless of HTTP status, so error responses would still "succeed" with no data returned.

This PR turns non-success responses into errors.

flavio commented 1 year ago

Thanks for the fix, the CI error is completely unrelated, I'll fix it with another PR