mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-07 22:47:49 +00:00
libpod: Add definition of containerPlatformState for FreeBSD
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>
This commit is contained in:
parent
498fe67ef7
commit
8f797ab661
4 changed files with 33 additions and 4 deletions
17
libpod/boltdb_state_freebsd.go
Normal file
17
libpod/boltdb_state_freebsd.go
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
//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
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//go:build !linux
|
||||
// +build !linux
|
||||
//go:build !linux && !freebsd
|
||||
// +build !linux,!freebsd
|
||||
|
||||
package libpod
|
||||
|
||||
|
|
|
|||
12
libpod/container_freebsd.go
Normal file
12
libpod/container_freebsd.go
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
//go:build freebsd
|
||||
// +build freebsd
|
||||
|
||||
package libpod
|
||||
|
||||
type containerPlatformState struct {
|
||||
// NetworkJail 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.
|
||||
NetworkJail string `json:"-"`
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//go:build !linux
|
||||
// +build !linux
|
||||
//go:build !linux && !freebsd
|
||||
// +build !linux,!freebsd
|
||||
|
||||
package libpod
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue