diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-11-07 10:55:51 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-07 10:55:51 -0800 |
commit | 1370c311f57673d6e3bfc529bc9819d472cfcecb (patch) | |
tree | cb9e53bea2c651c9c88c522b3c622def94037bbc /libpod/container_internal_linux.go | |
parent | ae031378619ba78bcd22a3c2ee9b276506c1dbd3 (diff) | |
parent | e022efa0f87b8c0d59ce8efeb370b3eeed145a28 (diff) | |
download | podman-1370c311f57673d6e3bfc529bc9819d472cfcecb.tar.gz podman-1370c311f57673d6e3bfc529bc9819d472cfcecb.tar.bz2 podman-1370c311f57673d6e3bfc529bc9819d472cfcecb.zip |
Merge pull request #1771 from baude/prepare
move defer'd function declaration ahead of prepare error return
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r-- | libpod/container_internal_linux.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index d89eefd3b..163cd75e7 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -496,9 +496,6 @@ func (c *Container) restore(ctx context.Context, keep bool) (err error) { } } - if err := c.prepare(); err != nil { - return err - } defer func() { if err != nil { if err2 := c.cleanup(ctx); err2 != nil { @@ -507,6 +504,10 @@ func (c *Container) restore(ctx context.Context, keep bool) (err error) { } }() + if err := c.prepare(); err != nil { + return err + } + // TODO: use existing way to request static IPs, once it is merged in ocicni // https://github.com/cri-o/ocicni/pull/23/ |