diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-11-28 07:00:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-28 07:00:24 -0800 |
commit | effd63d6d5c2541f09745261a1e9205fa531e526 (patch) | |
tree | 2f7a3f956fdc1dfcb0743da87fbec4abb02662a6 /cmd/podman | |
parent | d346996e1512ef6efb3800d6cb762d0409d12459 (diff) | |
parent | d3cde7cefe4eed4b8cb0723211c19352c55f3dcf (diff) | |
download | podman-effd63d6d5c2541f09745261a1e9205fa531e526.tar.gz podman-effd63d6d5c2541f09745261a1e9205fa531e526.tar.bz2 podman-effd63d6d5c2541f09745261a1e9205fa531e526.zip |
Merge pull request #1848 from adrianreber/master
Add tcp-established to checkpoint/restore
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/checkpoint.go | 9 | ||||
-rw-r--r-- | cmd/podman/restore.go | 13 |
2 files changed, 17 insertions, 5 deletions
diff --git a/cmd/podman/checkpoint.go b/cmd/podman/checkpoint.go index ddfd12bc3..824c97662 100644 --- a/cmd/podman/checkpoint.go +++ b/cmd/podman/checkpoint.go @@ -28,6 +28,10 @@ var ( Usage: "leave the container running after writing checkpoint to disk", }, cli.BoolFlag{ + Name: "tcp-established", + Usage: "checkpoint a container with established TCP connections", + }, + cli.BoolFlag{ Name: "all, a", Usage: "checkpoint all running containers", }, @@ -55,8 +59,9 @@ func checkpointCmd(c *cli.Context) error { defer runtime.Shutdown(false) options := libpod.ContainerCheckpointOptions{ - Keep: c.Bool("keep"), - KeepRunning: c.Bool("leave-running"), + Keep: c.Bool("keep"), + KeepRunning: c.Bool("leave-running"), + TCPEstablished: c.Bool("tcp-established"), } if err := checkAllAndLatest(c); err != nil { diff --git a/cmd/podman/restore.go b/cmd/podman/restore.go index 067a2b5d4..bc2a71ba0 100644 --- a/cmd/podman/restore.go +++ b/cmd/podman/restore.go @@ -27,6 +27,10 @@ var ( // dedicated state for container which are checkpointed. // TODO: add ContainerStateCheckpointed cli.BoolFlag{ + Name: "tcp-established", + Usage: "checkpoint a container with established TCP connections", + }, + cli.BoolFlag{ Name: "all, a", Usage: "restore all checkpointed containers", }, @@ -53,16 +57,19 @@ func restoreCmd(c *cli.Context) error { } defer runtime.Shutdown(false) - keep := c.Bool("keep") + options := libpod.ContainerCheckpointOptions{ + Keep: c.Bool("keep"), + TCPEstablished: c.Bool("tcp-established"), + } if err := checkAllAndLatest(c); err != nil { return err } - containers, lastError := getAllOrLatestContainers(c, runtime, libpod.ContainerStateRunning, "checkpointed") + containers, lastError := getAllOrLatestContainers(c, runtime, libpod.ContainerStateExited, "checkpointed") for _, ctr := range containers { - if err = ctr.Restore(context.TODO(), keep); err != nil { + if err = ctr.Restore(context.TODO(), options); err != nil { if lastError != nil { fmt.Fprintln(os.Stderr, lastError) } |