Revert "Remount /sys/fs/cgroup as readonly always"
This reverts commit 18de1a273e
.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
618e0caeca
commit
5b805276c2
|
@ -845,15 +845,6 @@ func TestMountCgroupRO(t *testing.T) {
|
||||||
mountInfo := buffers.Stdout.String()
|
mountInfo := buffers.Stdout.String()
|
||||||
lines := strings.Split(mountInfo, "\n")
|
lines := strings.Split(mountInfo, "\n")
|
||||||
for _, l := range lines {
|
for _, l := range lines {
|
||||||
if strings.HasPrefix(l, "tmpfs on /sys/fs/cgroup") {
|
|
||||||
if !strings.Contains(l, "ro,nosuid,nodev,noexec") {
|
|
||||||
t.Fatalf("Mode expected to contain 'ro,nosuid,nodev,noexec': %s", l)
|
|
||||||
}
|
|
||||||
if !strings.Contains(l, "mode=755") {
|
|
||||||
t.Fatalf("Mode expected to contain 'mode=755': %s", l)
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if !strings.HasPrefix(l, "cgroup") {
|
if !strings.HasPrefix(l, "cgroup") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -889,15 +880,6 @@ func TestMountCgroupRW(t *testing.T) {
|
||||||
mountInfo := buffers.Stdout.String()
|
mountInfo := buffers.Stdout.String()
|
||||||
lines := strings.Split(mountInfo, "\n")
|
lines := strings.Split(mountInfo, "\n")
|
||||||
for _, l := range lines {
|
for _, l := range lines {
|
||||||
if strings.HasPrefix(l, "tmpfs on /sys/fs/cgroup") {
|
|
||||||
if !strings.Contains(l, "ro,nosuid,nodev,noexec") {
|
|
||||||
t.Fatalf("Mode expected to contain 'ro,nosuid,nodev,noexec': %s", l)
|
|
||||||
}
|
|
||||||
if !strings.Contains(l, "mode=755") {
|
|
||||||
t.Fatalf("Mode expected to contain 'mode=755': %s", l)
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if !strings.HasPrefix(l, "cgroup") {
|
if !strings.HasPrefix(l, "cgroup") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,7 +196,6 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error {
|
||||||
Device: "tmpfs",
|
Device: "tmpfs",
|
||||||
Destination: m.Destination,
|
Destination: m.Destination,
|
||||||
Flags: defaultMountFlags,
|
Flags: defaultMountFlags,
|
||||||
Data: "mode=755",
|
|
||||||
}
|
}
|
||||||
if err := mountToRootfs(tmpfs, rootfs, mountLabel); err != nil {
|
if err := mountToRootfs(tmpfs, rootfs, mountLabel); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -206,11 +205,6 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// remount cgroup root as readonly
|
|
||||||
rootfsCgroup := filepath.Join(rootfs, m.Destination)
|
|
||||||
if err := syscall.Mount("", rootfsCgroup, "", defaultMountFlags|syscall.MS_REMOUNT|syscall.MS_RDONLY, ""); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("unknown mount device %q to %q", m.Device, m.Destination)
|
return fmt.Errorf("unknown mount device %q to %q", m.Device, m.Destination)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue