From 5539a2a2283048f49c529b34912b9d67e9830acb Mon Sep 17 00:00:00 2001 From: baude Date: Fri, 13 Sep 2019 10:00:49 -0500 Subject: 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 --- cmd/podman/push.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cmd/podman') 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 -- cgit v1.2.3-54-g00ecf