Take runtimeArgs in account when loading containers state
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
bac78851e0
commit
3f388f8638
1 changed files with 12 additions and 1 deletions
|
@ -8,6 +8,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -218,7 +219,17 @@ func (c *container) startCmd(pid string, cmd *exec.Cmd, p *process) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *container) getLibctContainer() (libcontainer.Container, error) {
|
func (c *container) getLibctContainer() (libcontainer.Container, error) {
|
||||||
f, err := libcontainer.New("/run/runc", libcontainer.Cgroupfs)
|
runtimeRoot := "/run/runc"
|
||||||
|
|
||||||
|
// Check that the root wasn't changed
|
||||||
|
for _, opt := range c.runtimeArgs {
|
||||||
|
if strings.HasPrefix(opt, "--root=") {
|
||||||
|
runtimeRoot = strings.TrimPrefix(opt, "--root=")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
f, err := libcontainer.New(runtimeRoot, libcontainer.Cgroupfs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue