diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-09-06 12:43:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-06 12:43:55 +0200 |
commit | 6b3bb9e75e239f4470bca843f0a2cdf5b5e9b82c (patch) | |
tree | c3504335e6f65b5262a24c88a7dac0da978ae531 /libpod/container_linux.go | |
parent | a61a9525e37f6a3a76e8e12b61dac5131700e9d1 (diff) | |
parent | a3aecf0f26971cbf178fc705d0983ee248a6492b (diff) | |
download | podman-6b3bb9e75e239f4470bca843f0a2cdf5b5e9b82c.tar.gz podman-6b3bb9e75e239f4470bca843f0a2cdf5b5e9b82c.tar.bz2 podman-6b3bb9e75e239f4470bca843f0a2cdf5b5e9b82c.zip |
Merge pull request #15632 from dfr/freebsd-container
Add support for FreeBSD containers
Diffstat (limited to 'libpod/container_linux.go')
-rw-r--r-- | libpod/container_linux.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libpod/container_linux.go b/libpod/container_linux.go index 8b517e69f..9c17a1966 100644 --- a/libpod/container_linux.go +++ b/libpod/container_linux.go @@ -5,6 +5,7 @@ package libpod import ( "github.com/containernetworking/plugins/pkg/ns" + spec "github.com/opencontainers/runtime-spec/specs-go" ) type containerPlatformState struct { @@ -13,3 +14,17 @@ type containerPlatformState struct { // told to join another container's network namespace NetNS ns.NetNS `json:"-"` } + +func networkDisabled(c *Container) (bool, error) { + if c.config.CreateNetNS { + return false, nil + } + if !c.config.PostConfigureNetNS { + for _, ns := range c.config.Spec.Linux.Namespaces { + if ns.Type == spec.NetworkNamespace { + return ns.Path == "", nil + } + } + } + return false, nil +} |