mirror of https://github.com/containers/podman.git
Merge pull request #19531 from dfr/freebsd-kube
libpod: fix a crash in 'kube generate' on FreeBSD
This commit is contained in:
commit
e9a3b7cfa1
|
@ -1210,9 +1210,11 @@ 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
|
||||
if c.config.Spec.Linux != nil {
|
||||
for _, ns := range c.config.Spec.Linux.Namespaces {
|
||||
if ns.Type == spec.NetworkNamespace {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
|
Loading…
Reference in New Issue