From a148c16225241aaf25a36980973f8e4bcf08a647 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Sat, 27 Aug 2022 14:35:45 +0100 Subject: libpod: Use (*Container).addNetworkNamespace to restore checkpoint network [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson --- libpod/container_internal_common.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'libpod') diff --git a/libpod/container_internal_common.go b/libpod/container_internal_common.go index f9c1ea12e..d3e37802f 100644 --- a/libpod/container_internal_common.go +++ b/libpod/container_internal_common.go @@ -1313,15 +1313,8 @@ func (c *Container) restore(ctx context.Context, options ContainerCheckpointOpti } // We want to have the same network namespace as before. - if c.config.CreateNetNS { - netNSPath := "" - if !c.config.PostConfigureNetNS { - netNSPath = c.state.NetNS.Path() - } - - if err := g.AddOrReplaceLinuxNamespace(string(spec.NetworkNamespace), netNSPath); err != nil { - return nil, 0, err - } + if err := c.addNetworkNamespace(&g); err != nil { + return nil, 0, err } if options.Pod != "" { -- cgit v1.2.3-54-g00ecf