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
mount: some refactor and improved GoDoc about Windows support #31
Conversation
Relates to moby/moby#41458 (comment) ping @kolyshkin @cpuguy83 PTAL |
Thanks! Is it possible to add some CI job to prevent this kinds of mishap in the future? |
It looks like Perhaps we can make both no-op? This will
|
6a27b5f
to
8b5e03d
Compare
@kolyshkin updated, but I noticed that before 0c569e0, Actually thinking now if we should accept the breaking change and update downstream code or not 🤔 (the package is still pre v1.0, so from that perspective, it should be ok) |
If you can just change Yet we need to decide first whether we want them both to be no-op or panic. I don't have a strong preference but would like to hear other opinions. |
moby/moby#41458 (comment) it seems that the panic behavior is better than no-op. In these two cases, it clearly tells the test is not working (and it should not work on Windows). So, I'm in favor of panic. |
8b5e03d
to
b4a0e04
Compare
mount/mount.go
Outdated
// RecursiveUnmount is not implemented on Windows. | ||
func RecursiveUnmount(target string) error { |
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.
So, alternatively, I guess we could not implement at all on Windows (move this to a _linux.go
or _unix.go
wdyt?
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.
Yeah, I think the rename + build flags will be slightly cleaner.
What I'd like to see here is a minimal patch. Moving lots of code around makes it harder to dig through git history, and unless there is a good reason to, I'd rather not do it. Maybe I'm wrong and this is unavoidable. |
The situation currently is that we have separate files for platform-specific implementations, but there's code in files that doesn't work on the platform it's enabled on. So, yes, I agree that a smaller diff would be good, but it looks like code is in the wrong files. |
b4a0e04
to
7e37eaf
Compare
I see @kolyshkin preferred "Yeah, I think the rename + build flags will be slightly cleaner."; let me have a look what that looks like. |
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
585c7f1
to
832bd36
Compare
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@kolyshkin pushed a commit with those changes; if you think this looks good, I'll squash |
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
Commit 0c569e0 (#26) added a fast-path for Linux, but inadvertendly changed the behavior on Windows, which previously handled RecursiveUnmount() as a no-op, and now panicked.This patch makes RecursiveUnmount() a no-op again on Windows.[Kir: fixed commit/PR reference]