From 7f28fd938607df64e8844f3125838fc659753843 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Wed, 27 Apr 2022 17:06:30 -0400 Subject: Report properly whether pod shares host network Fixes: https://github.com/containers/podman/issues/14028 Signed-off-by: Daniel J Walsh --- libpod/pod.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libpod/pod.go') diff --git a/libpod/pod.go b/libpod/pod.go index ed2d97b37..6cfe76a18 100644 --- a/libpod/pod.go +++ b/libpod/pod.go @@ -159,6 +159,15 @@ func (p *Pod) CPUQuota() int64 { return 0 } +// NetworkMode returns the Network mode given by the user ex: pod, private... +func (p *Pod) NetworkMode() string { + infra, err := p.runtime.GetContainer(p.state.InfraContainerID) + if err != nil { + return "" + } + return infra.NetworkMode() +} + // PidMode returns the PID mode given by the user ex: pod, private... func (p *Pod) PidMode() string { infra, err := p.runtime.GetContainer(p.state.InfraContainerID) -- cgit v1.2.3-54-g00ecf