Skip to content
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

Allow for binding a named pipe on Windows #2661

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

TinaMor
Copy link
Contributor

@TinaMor TinaMor commented Nov 27, 2023

PR Description

This PR fixes:

Also, adds a check in create.go#L298 to log a warning only when there is an error

@TinaMor TinaMor marked this pull request as draft November 28, 2023 05:07
@TinaMor TinaMor force-pushed the fix-windows-volume-mount branch 3 times, most recently from edf558a to 8fd5fe0 Compare November 28, 2023 06:08
Copy link
Contributor

@aznashwan aznashwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First review pass done, mostly LGTM but I suggested some added checks or minor changes to the newly-added helper functions.

pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
@TinaMor TinaMor force-pushed the fix-windows-volume-mount branch 3 times, most recently from 48b3686 to 9341076 Compare December 1, 2023 15:33
Copy link
Contributor

@aznashwan aznashwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second review pass done with some just some minor nits.

Currently unsure why the Linux mount-related tests are failing, recommend adding extra logging to the changed functions and maybe even the testutils.AssertXYZ() helper functions to further aid debugging.

pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil_nonwindows.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil_windows.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Show resolved Hide resolved
Copy link

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped in comments just for sanity checks. I'm not fully conversant with the project, so didn't give any functional related feedback.

Good work!

pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil.go Show resolved Hide resolved
pkg/mountutil/mountutil.go Outdated Show resolved Hide resolved
if !os.IsNotExist(err) {
return fmt.Errorf("failed to stat %q: %w", src, err)
}
if err := os.MkdirAll(src, 0o755); err != nil {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about the 755 permission, is it the least needed for everything to work -- seems a bit too much, anything in the 6xx ranges?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just moved this part of the code. But read and execute permission on the dir for users other than the owner seems ok.

@AkihiroSuda, should we change the permission?

pkg/mountutil/mountutil.go Show resolved Hide resolved
pkg/mountutil/mountutil_windows.go Outdated Show resolved Hide resolved
@TinaMor TinaMor marked this pull request as ready for review December 8, 2023 17:33
Copy link
Contributor

@jsturtevant jsturtevant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on! Looks good over all, a few minor comments. I think this also resolves #759 and would replace #924.

cmd/nerdctl/container_run_mount_linux_test.go Outdated Show resolved Hide resolved
cmd/nerdctl/container_run_mount_linux_test.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil_nonwindows.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil_windows.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil_windows.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil_nonwindows.go Outdated Show resolved Hide resolved
@TinaMor TinaMor force-pushed the fix-windows-volume-mount branch 4 times, most recently from 3c7843e to c0f1514 Compare December 12, 2023 16:51
Copy link
Contributor

@jsturtevant jsturtevant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple minor comments but overall LGTM

cmd/nerdctl/container_run_mount_linux_test.go Show resolved Hide resolved
pkg/mountutil/mountutil_windows.go Outdated Show resolved Hide resolved
pkg/mountutil/mountutil_windows.go Outdated Show resolved Hide resolved
@TinaMor TinaMor force-pushed the fix-windows-volume-mount branch 8 times, most recently from 18cda77 to fc5dae0 Compare December 19, 2023 05:35
@TinaMor TinaMor closed this Dec 19, 2023
@TinaMor TinaMor reopened this Dec 19, 2023
@AkihiroSuda AkihiroSuda added this to the v1.7.3 (tentative) milestone Dec 19, 2023
@AkihiroSuda AkihiroSuda added the platform/Windows/Non-WSL2 Microsoft Windows (non-WSL2) label Dec 19, 2023
@AkihiroSuda
Copy link
Member

Needs rebase

    - Allow users to bind a named pipe on Windows
    - Refactor windows volume spec split
    - Split mount code for Linux and Windows environments
    - Adds a check in create.go#L298 to log a warning only when there is an error

Signed-off-by: Christine Murimi <mor.tina@outlook.com>
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit 406a6fb into containerd:main Dec 28, 2023
22 checks passed
@AkihiroSuda AkihiroSuda modified the milestones: v2.0.0, v1.7.3 Jan 31, 2024
@TinaMor TinaMor mentioned this pull request Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/Windows/Non-WSL2 Microsoft Windows (non-WSL2)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants