summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
authorumohnani8 <umohnani@redhat.com>2018-04-18 16:48:35 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-19 14:08:47 +0000
commit27107fdac1d75f97caab47cd13efb1d9900cf350 (patch)
treef5edafbb52505829b15e19ea6a9e66f4440e862b /libpod/container_api.go
parent6a9dbf3305e93e5e1c3bff09402a9b801c935fbd (diff)
downloadpodman-27107fdac1d75f97caab47cd13efb1d9900cf350.tar.gz
podman-27107fdac1d75f97caab47cd13efb1d9900cf350.tar.bz2
podman-27107fdac1d75f97caab47cd13efb1d9900cf350.zip
Vendor in latest containers/image and contaners/storage
Made necessary changes to functions to include contex.Context wherever needed Signed-off-by: umohnani8 <umohnani@redhat.com> Closes: #640 Approved by: baude
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index b038787f5..aa1e7966f 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -1,6 +1,7 @@
package libpod
import (
+ "context"
"io/ioutil"
"os"
"strconv"
@@ -18,7 +19,7 @@ import (
)
// Init creates a container in the OCI runtime
-func (c *Container) Init() (err error) {
+func (c *Container) Init(ctx context.Context) (err error) {
if !c.batched {
c.lock.Lock()
defer c.lock.Unlock()
@@ -52,7 +53,7 @@ func (c *Container) Init() (err error) {
}
}()
- return c.init()
+ return c.init(ctx)
}
// Start starts a container
@@ -61,7 +62,7 @@ func (c *Container) Init() (err error) {
// started
// Stopped containers will be deleted and re-created in runc, undergoing a fresh
// Init()
-func (c *Container) Start() (err error) {
+func (c *Container) Start(ctx context.Context) (err error) {
if !c.batched {
c.lock.Lock()
defer c.lock.Unlock()
@@ -100,12 +101,12 @@ func (c *Container) Start() (err error) {
if c.state.State == ContainerStateStopped {
// Reinitialize the container if we need to
- if err := c.reinit(); err != nil {
+ if err := c.reinit(ctx); err != nil {
return err
}
} else if c.state.State == ContainerStateConfigured {
// Or initialize it for the first time if necessary
- if err := c.init(); err != nil {
+ if err := c.init(ctx); err != nil {
return err
}
}
@@ -124,7 +125,7 @@ func (c *Container) Start() (err error) {
// attach call.
// The channel will be closed automatically after the result of attach has been
// sent
-func (c *Container) StartAndAttach(streams *AttachStreams, keys string, resize <-chan remotecommand.TerminalSize) (attachResChan <-chan error, err error) {
+func (c *Container) StartAndAttach(ctx context.Context, streams *AttachStreams, keys string, resize <-chan remotecommand.TerminalSize) (attachResChan <-chan error, err error) {
if !c.batched {
c.lock.Lock()
defer c.lock.Unlock()
@@ -163,12 +164,12 @@ func (c *Container) StartAndAttach(streams *AttachStreams, keys string, resize <
if c.state.State == ContainerStateStopped {
// Reinitialize the container if we need to
- if err := c.reinit(); err != nil {
+ if err := c.reinit(ctx); err != nil {
return nil, err
}
} else if c.state.State == ContainerStateConfigured {
// Or initialize it for the first time if necessary
- if err := c.init(); err != nil {
+ if err := c.init(ctx); err != nil {
return nil, err
}
}