aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-11-28 07:00:24 -0800
committerGitHub <noreply@github.com>2018-11-28 07:00:24 -0800
commiteffd63d6d5c2541f09745261a1e9205fa531e526 (patch)
tree2f7a3f956fdc1dfcb0743da87fbec4abb02662a6 /cmd
parentd346996e1512ef6efb3800d6cb762d0409d12459 (diff)
parentd3cde7cefe4eed4b8cb0723211c19352c55f3dcf (diff)
downloadpodman-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')
-rw-r--r--cmd/podman/checkpoint.go9
-rw-r--r--cmd/podman/restore.go13
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)
}