diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-01-12 07:57:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 07:57:05 -0500 |
commit | 5575c7be2023d0709432b12b60124168c6956c8a (patch) | |
tree | 3856aabbe4003f23663978d3f01062a091d80c1c /libpod/container_api.go | |
parent | 1955eee89f083ec814a44025dc0abe59748205b3 (diff) | |
parent | 2aa381f2d0cdc8abb28aa8759c681198cb1e47a7 (diff) | |
download | podman-5575c7be2023d0709432b12b60124168c6956c8a.tar.gz podman-5575c7be2023d0709432b12b60124168c6956c8a.tar.bz2 podman-5575c7be2023d0709432b12b60124168c6956c8a.zip |
Merge pull request #8819 from chen-zhuohan/add-pre-checkpoint
Add pre-checkpoint and restore with previous
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r-- | libpod/container_api.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go index 2c7dc79c9..87ff764e3 100644 --- a/libpod/container_api.go +++ b/libpod/container_api.go @@ -706,6 +706,13 @@ type ContainerCheckpointOptions struct { // IgnoreVolumes tells the API to not export or not to import // the content of volumes associated with the container IgnoreVolumes bool + // Pre Checkpoint container and leave container running + PreCheckPoint bool + // Dump container with Pre Checkpoint images + WithPrevious bool + // ImportPrevious tells the API to restore container with two + // images. One is TargetFile, the other is ImportPrevious. + ImportPrevious string } // Checkpoint checkpoints a container @@ -718,6 +725,12 @@ func (c *Container) Checkpoint(ctx context.Context, options ContainerCheckpointO } } + if options.WithPrevious { + if err := c.canWithPrevious(); err != nil { + return err + } + } + if !c.batched { c.lock.Lock() defer c.lock.Unlock() |