summaryrefslogtreecommitdiff
path: root/libpod/container.go
diff options
context:
space:
mode:
authorMilivoje Legenovic <m.legenovic@gmail.com>2021-01-27 23:20:28 +0100
committerMilivoje Legenovic <m.legenovic@gmail.com>2021-01-30 09:08:36 +0100
commitcdbbc6120bad7c9310c4f3500fafa4b6c4d15c57 (patch)
tree45a5ec473a81ab3413fdf56fefd0e4f044ea8c8f /libpod/container.go
parent2686e406a650f8ceac4b3763e0cfba16090d1c1b (diff)
downloadpodman-cdbbc6120bad7c9310c4f3500fafa4b6c4d15c57.tar.gz
podman-cdbbc6120bad7c9310c4f3500fafa4b6c4d15c57.tar.bz2
podman-cdbbc6120bad7c9310c4f3500fafa4b6c4d15c57.zip
podman generate kube ignores --network=host
Signed-off-by: Milivoje Legenovic <m.legenovic@gmail.com>
Diffstat (limited to 'libpod/container.go')
-rw-r--r--libpod/container.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/libpod/container.go b/libpod/container.go
index 58bf95470..ed7535bc8 100644
--- a/libpod/container.go
+++ b/libpod/container.go
@@ -1073,6 +1073,18 @@ func networkDisabled(c *Container) (bool, error) {
return false, nil
}
+func (c *Container) HostNetwork() bool {
+ if c.config.CreateNetNS || c.config.NetNsCtr != "" {
+ return false
+ }
+ for _, ns := range c.config.Spec.Linux.Namespaces {
+ if ns.Type == spec.NetworkNamespace {
+ return false
+ }
+ }
+ return true
+}
+
// ContainerState returns containerstate struct
func (c *Container) ContainerState() (*ContainerState, error) {
if !c.batched {