Add cache push/pull#388
Open
mbj wants to merge 2 commits into
Open
Conversation
ea39e3b to
1c46098
Compare
31c2771 to
fed38ca
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.