summaryrefslogtreecommitdiff
path: root/libpod/container.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-01 04:16:53 -0500
committerGitHub <noreply@github.com>2021-02-01 04:16:53 -0500
commit4ead8067cd0fb0ee3dcf8245f81b97f8b25edc4d (patch)
tree88c067a82bdbe6de620e8192a0392233c0238808 /libpod/container.go
parent735b16e34721449781f82b10555b15e4aead0deb (diff)
parentcdbbc6120bad7c9310c4f3500fafa4b6c4d15c57 (diff)
downloadpodman-4ead8067cd0fb0ee3dcf8245f81b97f8b25edc4d.tar.gz
podman-4ead8067cd0fb0ee3dcf8245f81b97f8b25edc4d.tar.bz2
podman-4ead8067cd0fb0ee3dcf8245f81b97f8b25edc4d.zip
Merge pull request #9138 from mlegenovic/master
podman generate kube ignores --network=host
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 {