-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LCOW: lazycontext: Use correct lstat, fix archive check #37356
Conversation
@johnstep PTAL |
@cpuguy83 This addresses your feedback on the original PR: #37316 (comment) |
pkg/archive/archive_windows.go
Outdated
return "", fmt.Errorf("Windows path contains forward slash: %s", p) | ||
} | ||
return strings.Replace(p, string(os.PathSeparator), "/", -1), nil | ||
func CanonicalTarNameForPath(p string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems same as filepath.ToSlash()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, yes, indeed. Not sure how long it's been like that. Will update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought just removing this function completely but that can be a follow-up.
Codecov Report
@@ Coverage Diff @@
## master #37356 +/- ##
==========================================
+ Coverage 34.83% 34.85% +0.01%
==========================================
Files 610 610
Lines 44986 44981 -5
==========================================
+ Hits 15672 15677 +5
+ Misses 27201 27196 -5
+ Partials 2113 2108 -5 |
}{ | ||
{"foo", "foo", false}, | ||
{"foo/bar", "___", true}, // unix-styled windows path must fail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpuguy83 Is is a desired behavior for these paths to fail? I would think not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not fail but stay the same at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, added back in and updated to check they stay the same.
Signed-off-by: John Howard <[email protected]>
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@thaJeztah Is this a known failure in experimental and Janky - both failed the same, but restarted:
|
Janky https://jenkins.dockerproject.org/job/Docker-PRs/49887/console failing on a flaky test; tracked through #36501
Experimental https://jenkins.dockerproject.org/job/Docker-PRs-experimental/41137 also failing on a flaky test (tracked through #37246)
|
None of those failures are related in any way, so I'll go ahead and merge |
Signed-off-by: John Howard [email protected]
Fixes #36793. Replacement for #37316
First - thanks @yusuf-gunaydin for debugging and coming up with a fix. Yours was so very close :)
Here's the output using the same files as described in #36793 with the updated fix:
Note on the last build step:
bce0113cef4
correctly.During debugging this (happened to be building the Microsoft/opengcs repo as that exercises LCOW code quite well in lieu of format CI yet), as mentioned in the issue, I noticed that as the
Lstat
call is now being made, and can succeed, there's an incorrect assertion in generating the hash (prepareHash
function) when it calls into the archiver to Canonicalise the path, which causes build failures to occur on a step such asCOPY --from=runc /usr/bin/runc /usr/bin
. Have removed the incorrect assertion, updated the function to no longer return anerror
, and updated unit tests/call-sites not to handle the error there.