mirror of
https://github.com/containers/podman.git
synced 2025-06-23 10:38:20 +08:00
Merge pull request #19531 from dfr/freebsd-kube
libpod: fix a crash in 'kube generate' on FreeBSD
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user