Explicitly set rw
for privileged container.
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
parent
5f4035ae2f
commit
a5d1332e8f
@ -523,7 +523,7 @@ func clearReadOnly(m *runtimespec.Mount) {
|
|||||||
opt = append(opt, o)
|
opt = append(opt, o)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m.Options = opt
|
m.Options = append(opt, "rw")
|
||||||
}
|
}
|
||||||
|
|
||||||
// addDevices set device mapping without privilege.
|
// addDevices set device mapping without privilege.
|
||||||
|
@ -627,14 +627,14 @@ func TestPrivilegedBindMount(t *testing.T) {
|
|||||||
}
|
}
|
||||||
spec := g.Spec()
|
spec := g.Spec()
|
||||||
if test.expectedSysFSRO {
|
if test.expectedSysFSRO {
|
||||||
checkMount(t, spec.Mounts, "sysfs", "/sys", "sysfs", []string{"ro"}, nil)
|
checkMount(t, spec.Mounts, "sysfs", "/sys", "sysfs", []string{"ro"}, []string{"rw"})
|
||||||
} else {
|
} else {
|
||||||
checkMount(t, spec.Mounts, "sysfs", "/sys", "sysfs", nil, []string{"ro"})
|
checkMount(t, spec.Mounts, "sysfs", "/sys", "sysfs", []string{"rw"}, []string{"ro"})
|
||||||
}
|
}
|
||||||
if test.expectedCgroupFSRO {
|
if test.expectedCgroupFSRO {
|
||||||
checkMount(t, spec.Mounts, "cgroup", "/sys/fs/cgroup", "cgroup", []string{"ro"}, nil)
|
checkMount(t, spec.Mounts, "cgroup", "/sys/fs/cgroup", "cgroup", []string{"ro"}, []string{"rw"})
|
||||||
} else {
|
} else {
|
||||||
checkMount(t, spec.Mounts, "cgroup", "/sys/fs/cgroup", "cgroup", nil, []string{"ro"})
|
checkMount(t, spec.Mounts, "cgroup", "/sys/fs/cgroup", "cgroup", []string{"rw"}, []string{"ro"})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user