libpod: Use (*Container).addNetworkNamespace to restore checkpoint network
[NO NEW TESTS NEEDED]
@@ -1313,16 +1313,9 @@ 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 {
+ if err := c.addNetworkNamespace(&g); err != nil {
return nil, 0, err
}
- }
if options.Pod != "" {
// Running in a Pod means that we have to change all namespace settings to
