summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-07-19 02:38:26 +0200
committerGitHub <noreply@github.com>2019-07-19 02:38:26 +0200
commitdeb087d7b173832138c2e46ab4b7b626a98a910c (patch)
treea9d93d164fe83ba7229d17fd593639b7883fd8a2 /cmd/podman
parentb59abdc1b1cf72d86d3fe6bb76ba646870c86ed6 (diff)
parentc70657a6d1fc15ba60d4bb0fc197f4c70fa59cac (diff)
downloadpodman-deb087d7b173832138c2e46ab4b7b626a98a910c.tar.gz
podman-deb087d7b173832138c2e46ab4b7b626a98a910c.tar.bz2
podman-deb087d7b173832138c2e46ab4b7b626a98a910c.zip
Merge pull request #3443 from adrianreber/rootfs-changes-migration
Include changes to the container's root file-system in the checkpoint archive
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/checkpoint.go1
-rw-r--r--cmd/podman/cliconfig/config.go2
-rw-r--r--cmd/podman/restore.go7
3 files changed, 9 insertions, 1 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 c4146eff0..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,8 +61,12 @@ 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 used with --import")
+ return errors.Errorf("--name can only be used with --import")
}
if c.Name != "" && c.TcpEstablished {