← Back to issue list

oci: preserve directories when adding layers

View original Github issue

Metadata

Project
rockcraft
Number
#55
Type
pull request
State
merged
Author
tigarmo
Labels
—
Created
Updated
Closed

Current evaluation

Merged in canonical/rockcraft#55 via commit 2b13004b, preserving OCI directory permissions and ownership by adding source directories with relative arcnames; fixes #44.

Resolution: closed resolved

Reason: PR #55 was approved and merged as commit 2b13004b. Its directory-layer change explicitly fixes #44 by retaining subdirectory metadata in OCI layers.

Evaluated by: mr-cal-bot

No scores available.

Issue body

The previous code walked() on the source dir "manually" adding the files, possibly to preserve a path relative to the source dir. This had the side effect of not explicitly adding the sub directories, which meant that their attributes (permission, ownership) were not preserved in the final image (as they couldn't be!). So we simplify to add the whole directory at once, with a proper `arcname` to preserve the relative paths. Fixes #44 - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? ----- I plan to do two more pull requests "related" to this - splitting them to simplify review: - One to add some kind of 'integrated' test to double-verify that the permissions are preserved; - One small refactoring to use more `Path` and fewer `str`.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged in canonical/rockcraft#55 via commit 2b13004b, preserving OCI directory permissions and ownership by adding source directories with relative arcnames; fixes #44.
stealth/space-bunny-alpha — closed resolved Merged PR #55 replaced manual file walking with whole-directory OCI layer archiving using arcname, preserving directory paths and metadata. Fixed in commit 2b13004b.
stealth/space-bunny-alpha — closed resolved Merged PR #55 (commit 2b13004b, 'oci: preserve directories when adding layers') replaced manual per-file walk with a single add of the source dir using arcname, fixing #44 where directory permission/ownership metadata was dropped from OCI layers.
stealth/space-bunny-alpha — closed resolved Merged canonical/rockcraft#55, fixing #44 by adding source directories as whole OCI layers so directory permissions and ownership are preserved.
qwen/qwen3.6-35b-a3b — — Merged. Resolves #44 by preserving directory permissions and ownership when adding OCI image layers. Replaces manual file walking with a single directory addition using proper arcname. Approved and passed CI checks.
qwen3.6-35b-a3b-mtp-q6 — — Merged to resolve #44. Updated OCI layer addition to explicitly include directories with a proper arcname, preserving directory permissions and ownership that were previously lost during manual file traversal.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/rockcraft#44 (confidence 100%)

    The original permissions and ownership regression, explicitly closed by PR #55.

Related issues

No related issues found above the similarity threshold.