Skip to content

Commit 0194529

Browse files
committed
add support for --rootless
The --rootless flag was introduced in opencontainers/runc#1688. In most cases runc itself can detect the appropriate value, but it is considered to be there are some corner cases. Signed-off-by: Akihiro Suda <[email protected]>
1 parent 301f7c1 commit 0194529

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

runc.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ type Runc struct {
6666
Setpgid bool
6767
Criu string
6868
SystemdCgroup bool
69+
Rootless *bool // nil stands for "auto"
6970
}
7071

7172
// List returns all containers created inside the provided runc root directory
@@ -655,6 +656,10 @@ func (r *Runc) args() (out []string) {
655656
if r.SystemdCgroup {
656657
out = append(out, "--systemd-cgroup")
657658
}
659+
if r.Rootless != nil {
660+
// nil stands for "auto" (differs from explicit "false")
661+
out = append(out, "--rootless="+strconv.FormatBool(*r.Rootless))
662+
}
658663
return out
659664
}
660665

0 commit comments

Comments
 (0)