We only want a Reader, so be more precise.
More importantly, we want to remove all instances of the habit to use
bytes.NewBuffer instead of bytes.NewReader (which can actually be unsafe),
although that concern does not directly apply to these calls
Should not change (test) behavior.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Using the github.com/docker/distribution/registry/client package will
import many huge prometheus dependencies, e.g.
* github.com/prometheus/client_golang/prometheus/promhttp
* github.com/prometheus/client_golang/prometheus
* github.com/prometheus/procfs
and even more...
All of these dependencies are completely unused AFAICT but will still end
up in a binary because they are imported transitive.
github.com/docker/distribution/registry/client is only used to check
http errors so I think it makes sense to copy only the required code
into the docker package.
I vendored this commit into podman and it saves over 700KB in binary
size.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>