mirror of
https://github.com/containers/podman.git
synced 2025-12-05 04:40:47 +08:00
Merge pull request #3443 from adrianreber/rootfs-changes-migration
Include changes to the container's root file-system in the checkpoint archive
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user