summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorAdrian Reber <areber@redhat.com>2019-06-27 07:56:39 +0000
committerAdrian Reber <areber@redhat.com>2019-07-11 14:43:35 +0200
commit05549e8b2904427a1fb6d0b36889ac43360db073 (patch)
treef085e801b63094fb3f6c450ca9493f8a211414d8 /cmd
parent1a3207488477876a1f4018bf0df95ed8eaf85afc (diff)
downloadpodman-05549e8b2904427a1fb6d0b36889ac43360db073.tar.gz
podman-05549e8b2904427a1fb6d0b36889ac43360db073.tar.bz2
podman-05549e8b2904427a1fb6d0b36889ac43360db073.zip
Add --ignore-rootfs option for checkpoint/restore
The newly added functionality to include the container's root file-system changes into the checkpoint archive can now be explicitly disabled. Either during checkpoint or during restore. If a container changes a lot of files during its runtime it might be more effective to migrated the root file-system changes in some other way and to not needlessly increase the size of the checkpoint archive. If a checkpoint archive does not contain the root file-system changes information it will automatically be skipped. If the root file-system changes are part of the checkpoint archive it is also possible to tell Podman to ignore these changes. Signed-off-by: Adrian Reber <areber@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/checkpoint.go1
-rw-r--r--cmd/podman/cliconfig/config.go2
-rw-r--r--cmd/podman/restore.go5
3 files changed, 8 insertions, 0 deletions
diff --git a/cmd/podman/checkpoint.go b/cmd/podman/checkpoint.go
index 6755bb073..22cdb1f39 100644
--- a/cmd/podman/checkpoint.go
+++ b/cmd/podman/checkpoint.go
@@ -46,6 +46,7 @@ func init() {
flags.BoolVarP(&checkpointCommand.All, "all", "a", false, "Checkpoint all running containers")
flags.BoolVarP(&checkpointCommand.Latest, "latest", "l", false, "Act on the latest container podman is aware of")
flags.StringVarP(&checkpointCommand.Export, "export", "e", "", "Export the checkpoint image to a tar.gz")
+ flags.BoolVar(&checkpointCommand.IgnoreRootfs, "ignore-rootfs", false, "Do not include root file-system changes when exporting")
markFlagHiddenForRemoteClient("latest", flags)
}
diff --git a/cmd/podman/cliconfig/config.go b/cmd/podman/cliconfig/config.go
index e3e2edb95..be380cda0 100644
--- a/cmd/podman/cliconfig/config.go
+++ b/cmd/podman/cliconfig/config.go
@@ -92,6 +92,7 @@ type CheckpointValues struct {
All bool
Latest bool
Export string
+ IgnoreRootfs bool
}
type CommitValues struct {
@@ -433,6 +434,7 @@ type RestoreValues struct {
TcpEstablished bool
Import string
Name string
+ IgnoreRootfs bool
}
type RmValues struct {
diff --git a/cmd/podman/restore.go b/cmd/podman/restore.go
index 7ecec24ee..3ae141d41 100644
--- a/cmd/podman/restore.go
+++ b/cmd/podman/restore.go
@@ -45,6 +45,7 @@ func init() {
flags.BoolVar(&restoreCommand.TcpEstablished, "tcp-established", false, "Restore a container with established TCP connections")
flags.StringVarP(&restoreCommand.Import, "import", "i", "", "Restore from exported checkpoint archive (tar.gz)")
flags.StringVarP(&restoreCommand.Name, "name", "n", "", "Specify new name for container restored from exported checkpoint (only works with --import)")
+ flags.BoolVar(&restoreCommand.IgnoreRootfs, "ignore-rootfs", false, "Do not apply root file-system changes when importing from exported checkpoint")
markFlagHiddenForRemoteClient("latest", flags)
}
@@ -60,6 +61,10 @@ func restoreCmd(c *cliconfig.RestoreValues, cmd *cobra.Command) error {
}
defer runtime.DeferredShutdown(false)
+ if c.Import == "" && c.IgnoreRootfs {
+ return errors.Errorf("--ignore-rootfs can only be used with --import")
+ }
+
if c.Import == "" && c.Name != "" {
return errors.Errorf("--name can only be used with --import")
}