mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Add rprivate to CDI mount options
Some checks failed
Some checks failed
This ensures that mount propagation is set to rprivate for mounts from the host into the container. This aligns with the default in docker. Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
adb5e6719d
commit
d0103aa6a3
@ -109,7 +109,8 @@ containerEdits:
|
||||
- ro
|
||||
- nosuid
|
||||
- nodev
|
||||
- bind
|
||||
- rbind
|
||||
- rprivate
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
@ -111,7 +111,8 @@ containerEdits:
|
||||
- ro
|
||||
- nosuid
|
||||
- nodev
|
||||
- bind
|
||||
- rbind
|
||||
- rprivate
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
@ -52,7 +52,8 @@ func TestIPCMounts(t *testing.T) {
|
||||
"ro",
|
||||
"nosuid",
|
||||
"nodev",
|
||||
"bind",
|
||||
"rbind",
|
||||
"rprivate",
|
||||
"noexec",
|
||||
},
|
||||
},
|
||||
|
@ -71,7 +71,8 @@ func (d *mountsToContainerPath) Mounts() ([]Mount, error) {
|
||||
"ro",
|
||||
"nosuid",
|
||||
"nodev",
|
||||
"bind",
|
||||
"rbind",
|
||||
"rprivate",
|
||||
},
|
||||
}
|
||||
mounts = append(mounts, mount)
|
||||
|
@ -32,7 +32,8 @@ func TestMountsToContainerPath(t *testing.T) {
|
||||
"ro",
|
||||
"nosuid",
|
||||
"nodev",
|
||||
"bind",
|
||||
"rbind",
|
||||
"rprivate",
|
||||
}
|
||||
|
||||
testCases := []struct {
|
||||
|
@ -90,7 +90,8 @@ func (d *mounts) Mounts() ([]Mount, error) {
|
||||
"ro",
|
||||
"nosuid",
|
||||
"nodev",
|
||||
"bind",
|
||||
"rbind",
|
||||
"rprivate",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,8 @@ func TestMounts(t *testing.T) {
|
||||
"ro",
|
||||
"nosuid",
|
||||
"nodev",
|
||||
"bind",
|
||||
"rbind",
|
||||
"rprivate",
|
||||
}
|
||||
|
||||
logger, logHook := testlog.NewNullLogger()
|
||||
|
@ -79,12 +79,12 @@ func TestDiscovererFromCSVFiles(t *testing.T) {
|
||||
{
|
||||
Path: "/usr/lib/aarch64-linux-gnu/tegra/libv4l2_nvargus.so",
|
||||
HostPath: "/usr/lib/aarch64-linux-gnu/tegra/libv4l2_nvargus.so",
|
||||
Options: []string{"ro", "nosuid", "nodev", "bind"},
|
||||
Options: []string{"ro", "nosuid", "nodev", "rbind", "rprivate"},
|
||||
},
|
||||
{
|
||||
Path: "/usr/lib/aarch64-linux-gnu/tegra/libv4l2_nvargus.so",
|
||||
HostPath: "/usr/lib/aarch64-linux-gnu/tegra/libv4l2_nvargus.so",
|
||||
Options: []string{"ro", "nosuid", "nodev", "bind"},
|
||||
Options: []string{"ro", "nosuid", "nodev", "rbind", "rprivate"},
|
||||
},
|
||||
},
|
||||
expectedHooks: []discover.Hook{
|
||||
@ -135,12 +135,12 @@ func TestDiscovererFromCSVFiles(t *testing.T) {
|
||||
{
|
||||
Path: "/usr/lib/aarch64-linux-gnu/tegra/libv4l2_nvargus.so",
|
||||
HostPath: "/usr/lib/aarch64-linux-gnu/tegra/libv4l2_nvargus.so",
|
||||
Options: []string{"ro", "nosuid", "nodev", "bind"},
|
||||
Options: []string{"ro", "nosuid", "nodev", "rbind", "rprivate"},
|
||||
},
|
||||
{
|
||||
Path: "/usr/lib/aarch64-linux-gnu/tegra/libv4l2_nvargus.so",
|
||||
HostPath: "/usr/lib/aarch64-linux-gnu/tegra/libv4l2_nvargus.so",
|
||||
Options: []string{"ro", "nosuid", "nodev", "bind"},
|
||||
Options: []string{"ro", "nosuid", "nodev", "rbind", "rprivate"},
|
||||
},
|
||||
},
|
||||
expectedHooks: []discover.Hook{
|
||||
@ -175,7 +175,7 @@ func TestDiscovererFromCSVFiles(t *testing.T) {
|
||||
{
|
||||
Path: "/usr/lib/aarch64-linux-gnu/tegra/libv4l2_nvargus.so",
|
||||
HostPath: "/usr/lib/aarch64-linux-gnu/tegra/libv4l2_nvargus.so",
|
||||
Options: []string{"ro", "nosuid", "nodev", "bind"},
|
||||
Options: []string{"ro", "nosuid", "nodev", "rbind", "rprivate"},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user