fix(spur-net): apply OCI whiteouts safely - #610
Open
joshkmartinez wants to merge 3 commits into
Open
Conversation
joshkmartinez
marked this pull request as ready for review
August 11, 2026 02:47
joshkmartinez
requested review from
sajmera-pensando,
shiv-tyagi and
yansun1996
as code owners
August 11, 2026 02:47
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Spur’s OCI/Docker layer extraction to correctly and safely apply OCI whiteouts (including opaque markers) across both registry pulls (spur-net) and docker save imports (spur-cli), preventing lower-layer file leakage into flattened images.
Changes:
- Centralized OCI layer extraction into
spur-net::image_layer::extract, adding validation, safe path handling, whiteout support (regular + opaque), and file-type reconciliation. - Switched registry extraction (
oci.rs) and docker-save import (spur-cli/src/image.rs) to use the shared layer applier with appropriate unpack policies. - Added focused unit tests for whiteouts, ordering, path containment, and docker-save manifests; updated
spur-clideps for runtimetempfileusage.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/spur-net/src/oci.rs | Replaces bespoke tar extraction with shared image_layer::extract for registry layers. |
| crates/spur-net/src/image_layer.rs | Introduces the shared layer extraction implementation, whiteout handling, safety checks, and extensive tests. |
| crates/spur-cli/src/image.rs | Updates docker save import to stage extraction and apply layers via image_layer::extract; adds tests. |
| crates/spur-cli/Cargo.toml | Promotes tempfile to a runtime dependency to support staging directory creation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Closes #344.
Registry pulls only handled regular whiteouts, and Docker/Podman save imports did not handle whiteouts at all. That could leave files from lower layers in the flattened image.
The registry and daemon paths now use the same layer applier. it validates a layer before changing the rootfs, applies deletions before same-layer entries, handles opaque markers and file-type replacements, and rejects paths that escape the rootfs
Testing
spur-netsuite: 79 testsspur-clisuite: 358 unit tests and 1 integration testwas not able to fully test b/c I'm on macos, please confirm everything works as expected