mirror of
https://github.com/containers/podman.git
synced 2025-07-25 09:05:00 +08:00

For FreeBSD, we need the name of the 'network jail' which is the parent of all containers in a pod. Having a separate jail for the network configuration also simplifies the implementation of CNI plugins so we use this pattern for solitary containers as well as pods. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <dfr@rabson.org>
18 lines
495 B
Go
18 lines
495 B
Go
//go:build freebsd
|
|
// +build freebsd
|
|
|
|
package libpod
|
|
|
|
// replaceNetNS handle network namespace transitions after updating a
|
|
// container's state.
|
|
func replaceNetNS(netNSPath string, ctr *Container, newState *ContainerState) error {
|
|
// On FreeBSD, we just record the network jail's name in our state.
|
|
newState.NetworkJail = netNSPath
|
|
return nil
|
|
}
|
|
|
|
// getNetNSPath retrieves the netns path to be stored in the database
|
|
func getNetNSPath(ctr *Container) string {
|
|
return ctr.state.NetworkJail
|
|
}
|