Repository navigation
fix(imagecache): keep the owner an image layer gives its files - #115
Merged
Merged
Conversation
atelet unpacks layers with every capability dropped, so every file it writes belongs to root whatever the layer tar says. An actor that runs as its image's USER could not write what its image gave it: an image that creates a directory for its user saw it owned by root. atelet now records the tar's non-root owners in the layer metadata, with the setuid and setgid bits a chown clears, and ateom's FinalizeLayer applies them to the pooled layer tree once per layer node-wide, under a marker of its own. The merged rootfs presents them without copying anything up. A layer pooled before owners were recorded is backfilled from its tar headers the next time a pull reuses it. Signed-off-by: QuentinBisson <quentin@giantswarm.io>
2 tasks done
QuentinBisson
marked this pull request as ready for review
October 5, 2026 07:24
This was referenced Oct 5, 2026
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.
Problem
atelet unpacks image layers with every capability dropped, so every image-layer file is root's whatever the tar says (agent-substrate#2036). With #103 an actor runs as its image's
USER, and such a user cannot write what its image gave it: kagent's Go ADK golden boot fails withopen /config/config.json: permission deniedon 1.4.0-rc.2 (giantswarm/kagent-upstream#125).Change
atelet records the tar's non-root owners (with the setuid/setgid bits a chown clears) in the layer metadata; ateom's
FinalizeLayerapplies them to the pooled layer tree once per layer node-wide under its ownowners-appliedmarker, so the merged rootfs presents them with no copy-up. A layer pooled before this is backfilled from its tar headers when a pull reuses it. Written for upstream against agent-substrate#2036, which agent-substrate#1918 needs before it merges.Towards giantswarm/giantswarm#38054