Skip to content

Commit

Permalink
Merge pull request #13214 from adrianreber/2022-02-11-fix-tests
Browse files Browse the repository at this point in the history
Fix checkpoint/restore pod tests
  • Loading branch information
openshift-merge-robot authored Feb 11, 2022
2 parents 564404b + 4b90542 commit 1b22ad9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions libpod/runtime_ctr.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ func (r *Runtime) initContainerVariables(rSpec *spec.Spec, config *ContainerConf
}
// Reset the log path to point to the default
ctr.config.LogPath = ""
// Later in validate() the check is for nil. JSONDeepCopy sets it to an empty
// object. Resetting it to nil if it was nil before.
if config.StaticMAC == nil {
ctr.config.StaticMAC = nil
}
}

ctr.config.Spec = rSpec
Expand Down
7 changes: 7 additions & 0 deletions pkg/checkpoint/checkpoint_restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ func CRImportCheckpoint(ctx context.Context, runtime *libpod.Runtime, restoreOpt
return nil, errors.Errorf("pod %s does not share the network namespace", ctrConfig.Pod)
}
ctrConfig.NetNsCtr = infraContainer.ID()
for net, opts := range ctrConfig.Networks {
opts.StaticIPs = nil
opts.StaticMAC = nil
ctrConfig.Networks[net] = opts
}
ctrConfig.StaticIP = nil
ctrConfig.StaticMAC = nil
}

if ctrConfig.PIDNsCtr != "" {
Expand Down
4 changes: 0 additions & 4 deletions test/e2e/checkpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1081,10 +1081,6 @@ var _ = Describe("Podman checkpoint", func() {
})

namespaceCombination := []string{
"cgroup,ipc,net,uts,pid",
"cgroup,ipc,net,uts",
"cgroup,ipc,net",
"cgroup,ipc",
"ipc,net,uts,pid",
"ipc,net,uts",
"ipc,net",
Expand Down

0 comments on commit 1b22ad9

Please sign in to comment.