mirror of
https://github.com/containers/podman.git
synced 2025-10-17 03:04:21 +08:00
migration: add possibility to restore a container with a new name
The option to restore a container from an external checkpoint archive (podman container restore -i /tmp/checkpoint.tar.gz) restores a container with the same name and same ID as id had before checkpointing. This commit adds the option '--name,-n' to 'podman container restore'. With this option the restored container gets the name specified after '--name,-n' and a new ID. This way it is possible to restore one container multiple times. If a container is restored with a new name Podman will not try to request the same IP address for the container as it had during checkpointing. This implicitly assumes that if a container is restored from a checkpoint archive with a different name, that it will be restored multiple times and restoring a container multiple times with the same IP address will fail as each IP address can only be used once. Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
@ -820,6 +820,10 @@ type ContainerCheckpointOptions struct {
|
||||
// Import tells the API to read the checkpoint image from
|
||||
// the filename set in TargetFile
|
||||
TargetFile string
|
||||
// Name tells the API that during restore from an exported
|
||||
// checkpoint archive a new name should be used for the
|
||||
// restored container
|
||||
Name string
|
||||
}
|
||||
|
||||
// Checkpoint checkpoints a container
|
||||
|
Reference in New Issue
Block a user