Skip to content

Commit 911c89f

Browse files
committed
checkpoint: don't restore a container network namespace
A network namespace should not be dumped and restored, it is created by Docker even for restored containers.
1 parent f150324 commit 911c89f

3 files changed

Lines changed: 38 additions & 10 deletions

File tree

components/engine/libcontainerd/client_daemon.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,14 @@ func (c *client) CreateCheckpoint(ctx context.Context, containerID, checkpointDi
562562
return err
563563
}
564564

565-
img, err := p.(containerd.Task).Checkpoint(ctx)
565+
opts := []containerd.CheckpointTaskOpts{
566+
containerd.WithEmptyNamespace("network"),
567+
}
568+
if exit {
569+
opts = append(opts, containerd.WithExit)
570+
}
571+
572+
img, err := p.(containerd.Task).Checkpoint(ctx, opts...)
566573
if err != nil {
567574
return wrapError(err)
568575
}

components/engine/vendor/github.com/containerd/containerd/task.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/engine/vendor/github.com/containerd/containerd/task_opts.go

Lines changed: 24 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)