summaryrefslogtreecommitdiff
path: root/pkg/domain/infra
diff options
context:
space:
mode:
authorcdoern <cbdoer23@g.holycross.edu>2022-04-28 22:37:11 -0400
committerMatthew Heon <matthew.heon@pm.me>2022-05-05 16:02:00 -0400
commita8b55a3b9f8f2395d0d8ac3a4112fb3ff30da630 (patch)
tree9278e03278b954bef7e71a80bd38acbecba09e1e /pkg/domain/infra
parentb2025c64f43e74c84fb928f07df7bab3f776fe2d (diff)
downloadpodman-a8b55a3b9f8f2395d0d8ac3a4112fb3ff30da630.tar.gz
podman-a8b55a3b9f8f2395d0d8ac3a4112fb3ff30da630.tar.bz2
podman-a8b55a3b9f8f2395d0d8ac3a4112fb3ff30da630.zip
pass networks to container clone
since the network config is a string map, json.unmarshal does not recognize the config and spec as the same entity, need to map this option manually resolves #13713 Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r--pkg/domain/infra/abi/containers.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go
index 89b09bb1d..5ca678d6f 100644
--- a/pkg/domain/infra/abi/containers.go
+++ b/pkg/domain/infra/abi/containers.go
@@ -1548,6 +1548,12 @@ func (ic *ContainerEngine) ContainerClone(ctx context.Context, ctrCloneOpts enti
return nil, err
}
+ if len(spec.Networks) > 0 && pod.SharesNet() {
+ logrus.Warning("resetting network config, cannot specify a network other than the pod's when sharing the net namespace")
+ spec.Networks = nil
+ spec.NetworkOptions = nil
+ }
+
allNamespaces := []struct {
isShared bool
value *specgen.Namespace