From f07c5ac52afd9032a8fd9dc60e60c91d0914aa4d Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Tue, 29 Mar 2016 10:26:37 -0700 Subject: [PATCH] Ensure that runtimeArgs always get passed down to the oci runtime Signed-off-by: Kenfe-Mickael Laventure --- runtime/container.go | 6 +++++- runtime/container_linux.go | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/runtime/container.go b/runtime/container.go index db6cf21..bf73b83 100644 --- a/runtime/container.go +++ b/runtime/container.go @@ -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 } diff --git a/runtime/container_linux.go b/runtime/container_linux.go index 61bea83..d18a371 100644 --- a/runtime/container_linux.go +++ b/runtime/container_linux.go @@ -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") }