diff options
author | cdoern <cbdoer23@g.holycross.edu> | 2022-04-28 22:37:11 -0400 |
---|---|---|
committer | cdoern <cbdoer23@g.holycross.edu> | 2022-05-03 23:04:08 -0400 |
commit | 1585b175dbf47e7ee0d5a26600aaec898ec5c26b (patch) | |
tree | 9ec73b529ca361890dd06b973099561840e6c2e4 /pkg/domain | |
parent | ab3e072a0c3d321fd12cbd1f6ef8e322c6d9214a (diff) | |
download | podman-1585b175dbf47e7ee0d5a26600aaec898ec5c26b.tar.gz podman-1585b175dbf47e7ee0d5a26600aaec898ec5c26b.tar.bz2 podman-1585b175dbf47e7ee0d5a26600aaec898ec5c26b.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')
-rw-r--r-- | pkg/domain/infra/abi/containers.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/containers.go b/pkg/domain/infra/abi/containers.go index b56c36015..92e29c822 100644 --- a/pkg/domain/infra/abi/containers.go +++ b/pkg/domain/infra/abi/containers.go @@ -1544,6 +1544,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 |