summaryrefslogtreecommitdiff
path: root/libpod/container_api.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 /libpod/container_api.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 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index 390987394..df6b6e962 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -830,8 +830,15 @@ func (c *Container) Refresh(ctx context.Context) error {
return nil
}
+// ContainerCheckpointOptions is a struct used to pass the parameters
+// for checkpointing to corresponding functions
+type ContainerCheckpointOptions struct {
+ Keep bool
+ KeepRunning bool
+}
+
// Checkpoint checkpoints a container
-func (c *Container) Checkpoint(ctx context.Context, keep bool) error {
+func (c *Container) Checkpoint(ctx context.Context, options ContainerCheckpointOptions) error {
logrus.Debugf("Trying to checkpoint container %s", c)
if !c.batched {
c.lock.Lock()
@@ -842,7 +849,7 @@ func (c *Container) Checkpoint(ctx context.Context, keep bool) error {
}
}
- return c.checkpoint(ctx, keep)
+ return c.checkpoint(ctx, options)
}
// Restore restores a container