From 5dbb31a2129e79603cd467e243db04ed985e8751 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Thu, 18 Jul 2019 17:34:59 +0300 Subject: [PATCH] Use oci.With helpers Signed-off-by: Andrey Smirnov --- executor/oci/spec_unix.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/executor/oci/spec_unix.go b/executor/oci/spec_unix.go index cfd102d9a..66a2c440d 100644 --- a/executor/oci/spec_unix.go +++ b/executor/oci/spec_unix.go @@ -101,11 +101,11 @@ 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 i, m := range s.Mounts { - if m.Destination == "/sys/fs/cgroup" { - s.Mounts[i].Options = []string{"nosuid", "noexec", "nodev", "rw"} - } + if err = oci.WithWriteableCgroupfs(ctx, nil, c, s); err != nil { + return nil, nil, err + } + if err = oci.WithWriteableSysfs(ctx, nil, c, s); err != nil { + return nil, nil, err } }