Merge pull request #3451 from dsouzai/ns_last_pid

Allow mounting of /proc/sys/kernel/ns_last_pid
This commit is contained in:
Sebastiaan van Stijn authored and GitHub committed 2022-04-22 20:41:58 +02:00
commit 062fc87995
2 files changed
+9

No files matched your search

+1
View File
@@ -554,6 +554,7 @@ func checkProcMount(rootfs, dest, source string) error {
"/proc/loadavg",
"/proc/slabinfo",
"/proc/net/dev",
"/proc/sys/kernel/ns_last_pid",
}
for _, valid := range validProcMounts {
path, err := filepath.Rel(filepath.Join(rootfs, valid), dest)
+8
View File
@@ -38,6 +38,14 @@ func TestCheckMountDestFalsePositive(t *testing.T) {
}
}
func TestCheckMountDestNsLastPid(t *testing.T) {
dest := "/rootfs/proc/sys/kernel/ns_last_pid"
err := checkProcMount("/rootfs", dest, "/proc")
if err != nil {
t.Fatal("/proc/sys/kernel/ns_last_pid should not return an error")
}
}
func TestNeedsSetupDev(t *testing.T) {
config := &configs.Config{
Mounts: []*configs.Mount{