mirror of
https://github.com/containers/podman.git
synced 2025-05-20 00:27:03 +08:00

This replaces the NetworkJail string field with a struct pointer named NetNS. This does not try to emulate the complete NetNS interface but does help to re-use code that just refers to c.state.NetNS. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
32 lines
687 B
Go
32 lines
687 B
Go
//go:build freebsd
|
|
// +build freebsd
|
|
|
|
package libpod
|
|
|
|
type containerPlatformState struct {
|
|
// NetNS is the name of the container's network VNET
|
|
// jail. Will only be set if config.CreateNetNS is true, or
|
|
// the container was told to join another container's network
|
|
// namespace.
|
|
NetNS *jailNetNS `json:"-"`
|
|
}
|
|
|
|
type jailNetNS struct {
|
|
Name string `json:"-"`
|
|
}
|
|
|
|
func (ns *jailNetNS) Path() string {
|
|
// The jail name approximately corresponds to the Linux netns path
|
|
return ns.Name
|
|
}
|
|
|
|
func networkDisabled(c *Container) (bool, error) {
|
|
if c.config.CreateNetNS {
|
|
return false, nil
|
|
}
|
|
if !c.config.PostConfigureNetNS {
|
|
return c.state.NetNS != nil, nil
|
|
}
|
|
return false, nil
|
|
}
|