Skip to content

Add cache push/pull#388

Open
mbj wants to merge 2 commits into
mainfrom
cache/push-pull
Open

Add cache push/pull#388
mbj wants to merge 2 commits into
mainfrom
cache/push-pull

Conversation

@mbj
Copy link
Copy Markdown
Owner

@mbj mbj commented Apr 14, 2026

No description provided.

@mbj mbj force-pushed the cache/push-pull branch from cd1bc2c to 8e07aee Compare April 15, 2026 01:33
@mbj mbj force-pushed the cache/push-pull branch from 5b9db11 to fb82874 Compare May 8, 2026 01:04
@mbj mbj closed this May 11, 2026
@mbj mbj force-pushed the cache/push-pull branch from 79268d9 to 13a0b23 Compare May 11, 2026 04:32
@mbj mbj reopened this May 11, 2026
@mbj mbj force-pushed the cache/push-pull branch 3 times, most recently from ea39e3b to 1c46098 Compare May 12, 2026 02:02
@mbj mbj marked this pull request as ready for review May 12, 2026 02:14
@mbj mbj force-pushed the cache/push-pull branch 2 times, most recently from 31c2771 to fed38ca Compare May 12, 2026 02:56
mbj added 2 commits May 13, 2026 00:51
Previously `pull_image` panicked on any failure via `.unwrap()`. The
upcoming cache-walk-back flow needs to distinguish "the registry
does not have this tag" from "something else went wrong" so it can
fall through to an older cache stage without silently swallowing
auth or network errors.

Introduce `PullError::{NotFound, Other}` and a pure
`classify_pull_result` helper that maps (exit status, stderr bytes)
to the variant. NotFound is detected via the OCI distribution-spec
`MANIFEST_UNKNOWN` error code as rendered on stderr by docker,
podman, and skopeo — the substring `"manifest unknown"`. The
const comment documents why this is load-bearing string matching
and why every better-looking alternative (engine sockets, CLI
--json flags, manifest-inspect, direct registry HTTP) was rejected.

`pull_image_if_absent` now propagates the Result. The three
existing callers (two in pg-ephemeral/tests/base.rs, two in
ociman/tests/integration.rs, one in the ociman internal
backend::tests module) all `.unwrap()` — they want must-succeed
semantics.

Reference fields in PullError are boxed to stay under
clippy::result-large-err's 128-byte threshold.

Unit tests cover the classifier directly with canned stderr
strings for the four interesting cases: success, podman
not-found, docker not-found, auth failure, network error.
No network, no daemon, no registry required.
@mbj mbj force-pushed the cache/push-pull branch from 53faa0d to ec0ba22 Compare May 13, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant