diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-04-27 17:06:30 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2022-04-28 10:27:21 -0400 |
commit | 7f28fd938607df64e8844f3125838fc659753843 (patch) | |
tree | 16dba97f21bb623852762196ece971f71f67026e /libpod/pod.go | |
parent | 87454cf87a36f3cab0a8a613d20011fc896b1ce4 (diff) | |
download | podman-7f28fd938607df64e8844f3125838fc659753843.tar.gz podman-7f28fd938607df64e8844f3125838fc659753843.tar.bz2 podman-7f28fd938607df64e8844f3125838fc659753843.zip |
Report properly whether pod shares host network
Fixes: https://github.com/containers/podman/issues/14028
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/pod.go')
-rw-r--r-- | libpod/pod.go | 9 |
1 files changed, 9 insertions, 0 deletions
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) |