diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-31 11:12:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-31 11:12:05 +0100 |
commit | 5a53c6e5c97afe4c4add1d649b6f9d68204a8918 (patch) | |
tree | 3db189d698634e27a7a756b5f8ca5cb81a87c2f5 /libpod/networking_linux.go | |
parent | b6ab2df9d11a736c7781f200ff39c886f41e172d (diff) | |
parent | 2704dfbb7a3fc079a74e9c8edf1acd7be24db035 (diff) | |
download | podman-5a53c6e5c97afe4c4add1d649b6f9d68204a8918.tar.gz podman-5a53c6e5c97afe4c4add1d649b6f9d68204a8918.tar.bz2 podman-5a53c6e5c97afe4c4add1d649b6f9d68204a8918.zip |
Merge pull request #8203 from Luap99/fix-8194
Fix dnsname when joining a different network namespace in a pod
Diffstat (limited to 'libpod/networking_linux.go')
-rw-r--r-- | libpod/networking_linux.go | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go index 9ff6e40b7..28dca8dd8 100644 --- a/libpod/networking_linux.go +++ b/libpod/networking_linux.go @@ -102,17 +102,7 @@ func (r *Runtime) configureNetNS(ctr *Container, ctrNS ns.NetNS) ([]*cnitypes.Re requestedMAC = ctr.config.StaticMAC } - // If we are in a pod use the pod name for the network, otherwise the container name - var podName string - if ctr.PodID() != "" { - pod, err := r.GetPod(ctr.PodID()) - if err == nil { - podName = pod.Name() - } - } - if podName == "" { - podName = ctr.Name() - } + podName := getCNIPodName(ctr) podNetwork := r.getPodNetwork(ctr.ID(), podName, ctrNS.Path(), ctr.config.Networks, ctr.config.PortMappings, requestedIP, requestedMAC) |