Skip to content

Commit

Permalink
add support for --rootless
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
AkihiroSuda committed Jul 3, 2018
1 parent 301f7c1 commit 0194529
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions runc.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type Runc struct {
Setpgid bool
Criu string
SystemdCgroup bool
Rootless *bool // nil stands for "auto"
}

// List returns all containers created inside the provided runc root directory
Expand Down Expand Up @@ -655,6 +656,10 @@ func (r *Runc) args() (out []string) {
if r.SystemdCgroup {
out = append(out, "--systemd-cgroup")
}
if r.Rootless != nil {
// nil stands for "auto" (differs from explicit "false")
out = append(out, "--rootless="+strconv.FormatBool(*r.Rootless))
}
return out
}

Expand Down

0 comments on commit 0194529

Please sign in to comment.