Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Fix in-container device nodes for containerd runtime #653

Merged
merged 4 commits into from
Aug 10, 2020

Conversation

stealthybox
Copy link
Contributor

Devices are not namespaced in the Linux kernel.
Device-node paths are not dependent on any particular path in a mount namespace.
They are referred to globally by their major and minor number.

This was only working before for devices that had the same path in-container as on-host.
This patch creates a device-node in the sandbox container for the proper in-container specified path.

Fixes #646

I verified this makes volumes mount properly in vm's with containerd as the runtime.

@stealthybox stealthybox requested a review from twelho as a code owner August 4, 2020 22:25
@stealthybox stealthybox added area/runtime Issues related to container runtimes kind/bug Categorizes issue or PR as related to a bug. labels Aug 5, 2020
Copy link
Contributor

@darkowlzz darkowlzz left a comment

Choose a reason for hiding this comment

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

Tested it manually and it works great.
The test fails for docker+docker-bridge on CI consistently. But I couldn't reproduce it running it on my machine. It fails when stopping the VM. The test works fine without stopping the first VM, the file is accessible from the second VM. Maybe we can avoid the VM stop for now and deal with the stop issue separately.

//
// This is the e2e package to run tests for Ignite
// Currently, we do local e2e tests only
// we have to wait until the CI setup to allow Ignite to run with sudo and in a KVM environment.
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove these comments now.

Devices are not namespaced in the Linux kernel.
Device-node paths are not dependent on any particular path in a mount namespace.
They are referred to globally by their major and minor number.

This was only working before for devices that had the same path in-container as on-host.

This patch creates a device-node in the sandbox container for the proper in-container specified path.

Fixes weaveworks#646
@stealthybox
Copy link
Contributor Author

🚢

@stealthybox stealthybox merged commit 010c3b5 into weaveworks:master Aug 10, 2020
@stealthybox stealthybox deleted the ctrd-devpath-fix branch August 10, 2020 17:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/runtime Issues related to container runtimes kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mounting volume device using the --volumes flag not working
2 participants