summaryrefslogtreecommitdiff
path: root/cmd/podman/run.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 /cmd/podman/run.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 'cmd/podman/run.go')
-rw-r--r--cmd/podman/run.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd/podman/run.go b/cmd/podman/run.go
index ac6361070..abb319a63 100644
--- a/cmd/podman/run.go
+++ b/cmd/podman/run.go
@@ -58,13 +58,15 @@ func runCmd(c *cli.Context) error {
return errors.Errorf("image name or ID is required")
}
+ ctx := getContext()
+
rtc := runtime.GetConfig()
- newImage, err := runtime.ImageRuntime().New(c.Args()[0], rtc.SignaturePolicyPath, "", os.Stderr, nil, image.SigningOptions{}, false, false)
+ newImage, err := runtime.ImageRuntime().New(ctx, c.Args()[0], rtc.SignaturePolicyPath, "", os.Stderr, nil, image.SigningOptions{}, false, false)
if err != nil {
return errors.Wrapf(err, "unable to find image")
}
- data, err := newImage.Inspect()
+ data, err := newImage.Inspect(ctx)
if err != nil {
return err
}
@@ -105,7 +107,7 @@ func runCmd(c *cli.Context) error {
options = append(options, libpod.WithCgroupParent(createConfig.CgroupParent))
}
- ctr, err := runtime.NewContainer(runtimeSpec, options...)
+ ctr, err := runtime.NewContainer(ctx, runtimeSpec, options...)
if err != nil {
return err
}
@@ -133,7 +135,7 @@ func runCmd(c *cli.Context) error {
// Handle detached start
if createConfig.Detach {
- if err := ctr.Start(); err != nil {
+ if err := ctr.Start(ctx); err != nil {
// This means the command did not exist
exitCode = 127
if strings.Index(err.Error(), "permission denied") > -1 {