Commit Graph

4 Commits

Author SHA1 Message Date
Flavian Missi a10599b222 test distribution challenge error handling
Signed-off-by: Flavian Missi <fmissi@redhat.com>
2024-11-18 10:40:03 +01:00
Miloslav Trmač 22fadeed07 Use bytes.NewReader instead of bytes.NewBufferString
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>
2023-04-17 23:57:42 +02:00
Miloslav Trmač 055a29b7f6 Use io.NopCloser instead of a copy
Should not change (test) behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-04-17 23:57:33 +02:00
Paul Holzinger 5ace7abca5 Remove github.com/docker/distribution/registry/client package
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>
2022-09-06 18:40:49 +02:00