diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-05-05 05:51:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-05 05:51:19 -0400 |
commit | 7af4612d6b969329a78b4945c35a641449989a2d (patch) | |
tree | 1b4e70fa3cce85f9d0ab53ae0b3cd8fb97da0faf /pkg/domain/infra/abi/containers.go | |
parent | 97beca9e83ea5afee5f07249967cb1bdda2b9803 (diff) | |
parent | 1585b175dbf47e7ee0d5a26600aaec898ec5c26b (diff) | |
download | podman-7af4612d6b969329a78b4945c35a641449989a2d.tar.gz podman-7af4612d6b969329a78b4945c35a641449989a2d.tar.bz2 podman-7af4612d6b969329a78b4945c35a641449989a2d.zip |
Merge pull request #14059 from cdoern/clone
pass networks to container clone
Diffstat (limited to 'pkg/domain/infra/abi/containers.go')
-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 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 |