X Tutup
Skip to content

Commit aa97632

Browse files
committed
Merge pull request adamlaska#169 from mlaventure/fix-runtime-root
Ensure that --root is passed to oci when using runtime args
2 parents 5b0a213 + f07c5ac commit aa97632

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

runtime/container.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,11 @@ func (c *container) readSpec() (*specs.Spec, error) {
206206

207207
func (c *container) Delete() error {
208208
err := os.RemoveAll(filepath.Join(c.root, c.id))
209-
exec.Command(c.runtime, "delete", c.id).Run()
209+
210+
args := c.runtimeArgs
211+
args = append(args, "delete", c.id)
212+
exec.Command(c.runtime, args...).Run()
213+
210214
return err
211215
}
212216

runtime/container_linux.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,15 @@ func (c *container) Runtime() string {
5151
}
5252

5353
func (c *container) Pause() error {
54-
return exec.Command(c.runtime, "pause", c.id).Run()
54+
args := c.runtimeArgs
55+
args = append(args, "pause", c.id)
56+
return exec.Command(c.runtime, args...).Run()
5557
}
5658

5759
func (c *container) Resume() error {
58-
return exec.Command(c.runtime, "resume", c.id).Run()
60+
args := c.runtimeArgs
61+
args = append(args, "resume", c.id)
62+
return exec.Command(c.runtime, args...).Run()
5963
}
6064

6165
func (c *container) Checkpoints() ([]Checkpoint, error) {
@@ -107,6 +111,7 @@ func (c *container) Checkpoint(cpt Checkpoint) error {
107111
add := func(flags ...string) {
108112
args = append(args, flags...)
109113
}
114+
add(c.runtimeArgs...)
110115
if !cpt.Exit {
111116
add("--leave-running")
112117
}

0 commit comments

Comments
 (0)
X Tutup