summaryrefslogtreecommitdiff
path: root/cmd/podman/push.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-09-13 10:00:49 -0500
committerbaude <bbaude@redhat.com>2019-09-13 10:07:19 -0500
commit5539a2a2283048f49c529b34912b9d67e9830acb (patch)
tree4d9a0fe13425e23d55cd827b312c7a4063b02127 /cmd/podman/push.go
parent20772182e6a9f82403a668d228dfd81c8df06821 (diff)
downloadpodman-5539a2a2283048f49c529b34912b9d67e9830acb.tar.gz
podman-5539a2a2283048f49c529b34912b9d67e9830acb.tar.bz2
podman-5539a2a2283048f49c529b34912b9d67e9830acb.zip
get runtime for podman-remote push earlier
to prevent client side panics, we should get the runtime earlier in the process of push. Fixes: #4013 Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/push.go')
-rw-r--r--cmd/podman/push.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/podman/push.go b/cmd/podman/push.go
index 13ebe8a1f..52fbc652e 100644
--- a/cmd/podman/push.go
+++ b/cmd/podman/push.go
@@ -86,6 +86,12 @@ func pushCmd(c *cliconfig.PushValues) error {
destName = args[1]
}
+ runtime, err := adapter.GetRuntime(getContext(), &c.PodmanCommand)
+ if err != nil {
+ return errors.Wrapf(err, "could not create runtime")
+ }
+ defer runtime.DeferredShutdown(false)
+
// --compress and --format can only be used for the "dir" transport
splitArg := strings.SplitN(destName, ":", 2)
if c.Flag("compress").Changed || c.Flag("format").Changed {
@@ -106,12 +112,6 @@ func pushCmd(c *cliconfig.PushValues) error {
registryCreds = creds
}
- runtime, err := adapter.GetRuntime(getContext(), &c.PodmanCommand)
- if err != nil {
- return errors.Wrapf(err, "could not create runtime")
- }
- defer runtime.DeferredShutdown(false)
-
var writer io.Writer
if !c.Quiet {
writer = os.Stderr