archive: fix breakout error type assertions - #69
Merged
Conversation
thaJeztah
force-pushed
the
better_breakouterror
branch
from
July 22, 2026 12:50
54214c1 to
93d8e8c
Compare
Member
Author
|
Ugh; looks like it's failing; genuine issue? |
thaJeztah
force-pushed
the
better_breakouterror
branch
from
July 22, 2026 13:27
93d8e8c to
f0d2a95
Compare
thaJeztah
marked this pull request as draft
July 22, 2026 13:27
thaJeztah
force-pushed
the
better_breakouterror
branch
from
July 22, 2026 13:58
f0d2a95 to
010af54
Compare
thaJeztah
commented
Jul 22, 2026
Comment on lines
+958
to
+963
| // Avoid an unnecessary chown for the common non-remapped root-owned | ||
| // (0:0) case, where newly created implied directories are expected to | ||
| // already have the requested ownership. | ||
| if uid == 0 && gid == 0 { | ||
| return os.MkdirAll(parentPath, ImpliedDirectoryMode) | ||
| } |
Member
Author
There was a problem hiding this comment.
OK; that didn't work; user.MkdirAllAndChown does not only CHOWN, but also CHMOD implicitly, so skipping CHOWN also skips that, causing umask to be relevant again;
=== RUN TestImpliedDirectoryPermissions
=== RUN TestImpliedDirectoryPermissions/umask=022
=== RUN TestImpliedDirectoryPermissions/umask=027
archive_unix_test.go:118: assertion failed: -rwxr-x--- (fs.FileMode) != -rwxr-xr-x (expected fs.FileMode)
archive_unix_test.go:119: assertion failed: -rwxr-x--- (fs.FileMode) != -rwxr-xr-x (expected fs.FileMode)
archive_unix_test.go:120: assertion failed: -rwxr-x--- (fs.FileMode) != -rwxr-xr-x (expected fs.FileMode)
--- FAIL: TestImpliedDirectoryPermissions (0.00s)
--- PASS: TestImpliedDirectoryPermissions/umask=022 (0.00s)
--- FAIL: TestImpliedDirectoryPermissions/umask=027 (0.00s)
That makes the case stronger to re-design the API for moby/sys/user to allow those things being specified separately;
thaJeztah
force-pushed
the
better_breakouterror
branch
from
July 22, 2026 14:51
4bbd747 to
2cd5a3d
Compare
thaJeztah
force-pushed
the
better_breakouterror
branch
from
July 22, 2026 14:58
2cd5a3d to
a1cd8dd
Compare
breakoutError was an interface alias, causing errors.As() to match any non-nil error instead of only archive breakout errors. Replace it with a concrete wrapper type while preserving the existing breakoutError(err) helper. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
force-pushed
the
better_breakouterror
branch
from
July 22, 2026 15:34
a1cd8dd to
fcf3799
Compare
thaJeztah
marked this pull request as ready for review
July 22, 2026 15:34
vvoland
approved these changes
Jul 22, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #69 +/- ##
==========================================
+ Coverage 65.93% 65.96% +0.03%
==========================================
Files 42 42
Lines 2037 2039 +2
==========================================
+ Hits 1343 1345 +2
Misses 517 517
Partials 177 177 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
breakoutError was an interface alias, causing errors.As() to match any non-nil error instead of only archive breakout errors.
Replace it with a concrete wrapper type while preserving the existing breakoutError(err) helper.