mirror of
https://github.com/moby/buildkit.git
synced 2026-08-05 07:10:23 +00:00
Fix updating /sys/fs/cgroup mount to 'rw'
There were two bugs: Mount was matched by Type which is actually `cgroup`, not `sysfs`. And the second problem was that copy of the value was modified, not value in the slice. Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
This commit is contained in:
@@ -102,9 +102,9 @@ func GenerateSpec(ctx context.Context, meta executor.Meta, mounts []executor.Mou
|
||||
|
||||
if meta.SecurityMode == pb.SecurityMode_INSECURE {
|
||||
//make sysfs rw mount for insecure mode.
|
||||
for _, m := range s.Mounts {
|
||||
if m.Type == "sysfs" {
|
||||
m.Options = []string{"nosuid", "noexec", "nodev", "rw"}
|
||||
for i, m := range s.Mounts {
|
||||
if m.Destination == "/sys/fs/cgroup" {
|
||||
s.Mounts[i].Options = []string{"nosuid", "noexec", "nodev", "rw"}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user