summaryrefslogtreecommitdiff
path: root/libpod/networking_linux.go
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2021-03-17 09:30:55 +0100
committerPaul Holzinger <paul.holzinger@web.de>2021-04-01 17:27:03 +0200
commitd7e003f362bea73ca08ef224dba8c38543a2e953 (patch)
treecf87cec0a7ba667054c733d98e3f79aecad10c1e /libpod/networking_linux.go
parentdb19224b6dc35ac59062013256c73364eb024a99 (diff)
downloadpodman-d7e003f362bea73ca08ef224dba8c38543a2e953.tar.gz
podman-d7e003f362bea73ca08ef224dba8c38543a2e953.tar.bz2
podman-d7e003f362bea73ca08ef224dba8c38543a2e953.zip
Remove unused rootless-cni-infra container files
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'libpod/networking_linux.go')
-rw-r--r--libpod/networking_linux.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index d927b17d8..2734f7759 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -338,6 +338,18 @@ func (r *Runtime) setUpOCICNIPod(podNetwork ocicni.PodNetwork) ([]ocicni.NetResu
return results, err
}
+// getCNIPodName return the pod name (hostname) used by CNI and the dnsname plugin.
+// If we are in the pod network namespace use the pod name otherwise the container name
+func getCNIPodName(c *Container) string {
+ if c.config.NetMode.IsPod() || c.IsInfra() {
+ pod, err := c.runtime.GetPod(c.PodID())
+ if err == nil {
+ return pod.Name()
+ }
+ }
+ return c.Name()
+}
+
// Create and configure a new network namespace for a container
func (r *Runtime) configureNetNS(ctr *Container, ctrNS ns.NetNS) ([]*cnitypes.Result, error) {
var requestedIP net.IP