Merge pull request #15425 from dfr/freebsd-boltdb

libpod: Add definition of containerPlatformState for FreeBSD
This commit is contained in:
OpenShift Merge Robot 2022-08-23 13:27:50 -04:00 committed by GitHub
commit 3bcd8047cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 4 deletions

View 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
}

View File

@ -1,5 +1,5 @@
//go:build !linux
// +build !linux
//go:build !linux && !freebsd
// +build !linux,!freebsd
package libpod

View 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:"-"`
}

View File

@ -1,5 +1,5 @@
//go:build !linux
// +build !linux
//go:build !linux && !freebsd
// +build !linux,!freebsd
package libpod