Merge pull request #169 from mlaventure/fix-runtime-root
Ensure that --root is passed to oci when using runtime args
This commit is contained in:
commit
aa976325f5
2 changed files with 12 additions and 3 deletions
|
@ -206,7 +206,11 @@ func (c *container) readSpec() (*specs.Spec, error) {
|
|||
|
||||
func (c *container) Delete() error {
|
||||
err := os.RemoveAll(filepath.Join(c.root, c.id))
|
||||
exec.Command(c.runtime, "delete", c.id).Run()
|
||||
|
||||
args := c.runtimeArgs
|
||||
args = append(args, "delete", c.id)
|
||||
exec.Command(c.runtime, args...).Run()
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -51,11 +51,15 @@ func (c *container) Runtime() string {
|
|||
}
|
||||
|
||||
func (c *container) Pause() error {
|
||||
return exec.Command(c.runtime, "pause", c.id).Run()
|
||||
args := c.runtimeArgs
|
||||
args = append(args, "pause", c.id)
|
||||
return exec.Command(c.runtime, args...).Run()
|
||||
}
|
||||
|
||||
func (c *container) Resume() error {
|
||||
return exec.Command(c.runtime, "resume", c.id).Run()
|
||||
args := c.runtimeArgs
|
||||
args = append(args, "resume", c.id)
|
||||
return exec.Command(c.runtime, args...).Run()
|
||||
}
|
||||
|
||||
func (c *container) Checkpoints() ([]Checkpoint, error) {
|
||||
|
@ -107,6 +111,7 @@ func (c *container) Checkpoint(cpt Checkpoint) error {
|
|||
add := func(flags ...string) {
|
||||
args = append(args, flags...)
|
||||
}
|
||||
add(c.runtimeArgs...)
|
||||
if !cpt.Exit {
|
||||
add("--leave-running")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue