c8d: Fix image commit with userns mapping (carry)#46972
Merged
thaJeztah merged 2 commits intomoby:masterfrom Jan 3, 2024
Merged
c8d: Fix image commit with userns mapping (carry)#46972thaJeztah merged 2 commits intomoby:masterfrom
thaJeztah merged 2 commits intomoby:masterfrom
Conversation
The remapping in the commit code was in the wrong place, we would create a diff and then remap the snapshot, but the descriptor created in "CreateDiff" was still pointing to the old snapshot, we now remap the snapshot before creating a diff. Also make sure we don't lose any capabilities, they used to be lost after the chown. Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
856f624 to
711b01c
Compare
Member
Author
|
Marking this one as ready to review, I don't see any problems in the tests and any optimizations can come later if necessary. |
Member
|
Looks like there's a compile failure on Windows; |
711b01c to
fc25b1b
Compare
thaJeztah
reviewed
Dec 22, 2023
| xattrs[xattr] = data | ||
| } | ||
|
|
||
| if err := os.Lchown(path, uid, gid); err != nil { |
Member
There was a problem hiding this comment.
Can be in a follow-up, but considering to add some details about why these attributes are stripped in the first place (I was initially scratching my head on that), and why we have to go against that. Perhaps it's considered "common knowledge" but I wasn't aware (🙈) Djordje posted a link to https://lwn.net/Articles/244747/ on Slack, which made that clear to me.
Member
Author
There was a problem hiding this comment.
That sounds useful and would help me understand it as well.
thaJeztah
reviewed
Dec 22, 2023
Signed-off-by: Derek McGowan <derek@mcg.dev>
fc25b1b to
f74ca4e
Compare
This was referenced Jan 2, 2024
thaJeztah
approved these changes
Jan 3, 2024
Member
thaJeztah
left a comment
There was a problem hiding this comment.
LGTM let's bring this one in
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.
Alternative approach to #46938 as mentioned here.