aboutsummaryrefslogtreecommitdiff
path: root/pkg/checkpoint
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-12-13 18:20:31 +0100
committerPaul Holzinger <pholzing@redhat.com>2021-12-14 15:23:40 +0100
commit094e1d70dee1f5cc04987169615898bd6a4af499 (patch)
treed258979f88b5f1db292a171e3362a09f3ad6c759 /pkg/checkpoint
parent3e9af2029f1f92fbc069f81ba9ca90c090617e9c (diff)
downloadpodman-094e1d70dee1f5cc04987169615898bd6a4af499.tar.gz
podman-094e1d70dee1f5cc04987169615898bd6a4af499.tar.bz2
podman-094e1d70dee1f5cc04987169615898bd6a4af499.zip
container restore/import: store networks from db
It is important that we store the current networks from the db in the config. Also make sure to properly handle aliases and ignore static ip/mac addresses. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/checkpoint')
-rw-r--r--pkg/checkpoint/checkpoint_restore.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/checkpoint/checkpoint_restore.go b/pkg/checkpoint/checkpoint_restore.go
index c371adf5b..34bd8a124 100644
--- a/pkg/checkpoint/checkpoint_restore.go
+++ b/pkg/checkpoint/checkpoint_restore.go
@@ -78,6 +78,18 @@ func CRImportCheckpoint(ctx context.Context, runtime *libpod.Runtime, restoreOpt
}
}
+ if restoreOptions.IgnoreStaticIP || restoreOptions.IgnoreStaticMAC {
+ for net, opts := range ctrConfig.Networks {
+ if restoreOptions.IgnoreStaticIP {
+ opts.StaticIPs = nil
+ }
+ if restoreOptions.IgnoreStaticMAC {
+ opts.StaticMAC = nil
+ }
+ ctrConfig.Networks[net] = opts
+ }
+ }
+
ctrID := ctrConfig.ID
newName := false