summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
authorAdrian Reber <areber@redhat.com>2018-11-20 14:08:08 +0000
committerAdrian Reber <adrian@lisas.de>2018-11-20 17:25:44 +0100
commitff47a4c2d5485fc49f937f3ce0c4e2fd6bdb1956 (patch)
tree78beac1e6a0d70c39dbde1a4255f5c3b0aca023c /libpod/container_api.go
parentea928f2de6c111aeb92a7584675f2128abd3254e (diff)
downloadpodman-ff47a4c2d5485fc49f937f3ce0c4e2fd6bdb1956.tar.gz
podman-ff47a4c2d5485fc49f937f3ce0c4e2fd6bdb1956.tar.bz2
podman-ff47a4c2d5485fc49f937f3ce0c4e2fd6bdb1956.zip
Use a struct to pass options to Checkpoint()
For upcoming changes to the Checkpoint() functions this commit switches checkpoint options from a boolean to a struct, so that additional options can be passed easily to Checkpoint() without changing the function parameters all the time. Signed-off-by: Adrian Reber <areber@redhat.com>
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index 390987394..9f5436b14 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -830,8 +830,14 @@ 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
+}
+
// 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 +848,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