summaryrefslogtreecommitdiff
path: root/cmd/podman/checkpoint.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-11-21 05:11:12 -0800
committerGitHub <noreply@github.com>2018-11-21 05:11:12 -0800
commit1fdfeb87100aee82d4de17b2b3f9a81aedfcb6a8 (patch)
treeaadb41e32b4d66420b50a6b7b2dc62b404d03afb /cmd/podman/checkpoint.go
parent23feb0d6f9a6a43e44f959c99100ae24d6c27f6d (diff)
parent24c0739453b3f103a1b548c1bb611013b488afbe (diff)
downloadpodman-1fdfeb87100aee82d4de17b2b3f9a81aedfcb6a8.tar.gz
podman-1fdfeb87100aee82d4de17b2b3f9a81aedfcb6a8.tar.bz2
podman-1fdfeb87100aee82d4de17b2b3f9a81aedfcb6a8.zip
Merge pull request #1835 from adrianreber/master
Added option to keep container running after checkpointing
Diffstat (limited to 'cmd/podman/checkpoint.go')
-rw-r--r--cmd/podman/checkpoint.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd/podman/checkpoint.go b/cmd/podman/checkpoint.go
index bf280920d..ddfd12bc3 100644
--- a/cmd/podman/checkpoint.go
+++ b/cmd/podman/checkpoint.go
@@ -24,6 +24,10 @@ var (
Usage: "keep all temporary checkpoint files",
},
cli.BoolFlag{
+ Name: "leave-running, R",
+ Usage: "leave the container running after writing checkpoint to disk",
+ },
+ cli.BoolFlag{
Name: "all, a",
Usage: "checkpoint all running containers",
},
@@ -50,7 +54,10 @@ func checkpointCmd(c *cli.Context) error {
}
defer runtime.Shutdown(false)
- keep := c.Bool("keep")
+ options := libpod.ContainerCheckpointOptions{
+ Keep: c.Bool("keep"),
+ KeepRunning: c.Bool("leave-running"),
+ }
if err := checkAllAndLatest(c); err != nil {
return err
@@ -59,7 +66,7 @@ func checkpointCmd(c *cli.Context) error {
containers, lastError := getAllOrLatestContainers(c, runtime, libpod.ContainerStateRunning, "running")
for _, ctr := range containers {
- if err = ctr.Checkpoint(context.TODO(), keep); err != nil {
+ if err = ctr.Checkpoint(context.TODO(), options); err != nil {
if lastError != nil {
fmt.Fprintln(os.Stderr, lastError)
}