Files
containerd/core/remotes/docker
cshung 457fba3a38 remotes: surface OCI error body on HEAD 403 via GET fallback
When a registry returns 403 Forbidden on a HEAD request (e.g., manifest
resolve or push existence check), the diagnostic error body is lost
because HEAD responses carry no body per HTTP spec. This leaves users
with an opaque "403 Forbidden" message and no actionable guidance.

Add a follow-up GET on HEAD 403 to retrieve the registry's OCI error
body. The existing unexpectedResponseErr machinery already parses the
body into structured errors — it just needs the body to be present. The
fallback lives in a shared withGETErrorBody helper used by both the
pusher and resolver: it only enriches when the GET also returns 403, and
preserves the original HEAD request's method and status while borrowing
just the body, so the resulting error's status and body stay consistent.

Scoped to 403 only because it is rare (CMK key disabled, IP firewall,
RBAC misconfiguration) and its body is highly diagnostic, while other
status codes either already use GET or have bodies that add no value.

Fixes #8969

Signed-off-by: Andrew Au <cshung@gmail.com>
2026-07-08 18:27:10 +00:00
..
2026-03-15 14:56:35 +01:00
2024-01-17 09:52:21 -08:00
2024-01-17 09:52:21 -08:00
2026-03-15 18:24:13 +01:00
2024-01-17 09:52:21 -08:00
2024-01-17 09:55:58 -08:00
2024-01-25 22:18:45 -08:00