aboutsummaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-08-23 13:27:50 -0400
committerGitHub <noreply@github.com>2022-08-23 13:27:50 -0400
commit3bcd8047cff076d34887bd3be7ed0e5701a41a02 (patch)
treec9c88b6e9e1d39e857719f2163fb582bb51dbc18 /libpod
parentee2f8155cc85705787900db71f4154d358bd419d (diff)
parent8f797ab66166ec99d0eff0bb0aed997bb1876c5d (diff)
downloadpodman-3bcd8047cff076d34887bd3be7ed0e5701a41a02.tar.gz
podman-3bcd8047cff076d34887bd3be7ed0e5701a41a02.tar.bz2
podman-3bcd8047cff076d34887bd3be7ed0e5701a41a02.zip
Merge pull request #15425 from dfr/freebsd-boltdb
libpod: Add definition of containerPlatformState for FreeBSD
Diffstat (limited to 'libpod')
-rw-r--r--libpod/boltdb_state_freebsd.go17
-rw-r--r--libpod/boltdb_state_unsupported.go4
-rw-r--r--libpod/container_freebsd.go12
-rw-r--r--libpod/container_unsupported.go4
4 files changed, 33 insertions, 4 deletions
diff --git a/libpod/boltdb_state_freebsd.go b/libpod/boltdb_state_freebsd.go
new file mode 100644
index 000000000..d7f2736fc
--- /dev/null
+++ b/libpod/boltdb_state_freebsd.go
@@ -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
+}
diff --git a/libpod/boltdb_state_unsupported.go b/libpod/boltdb_state_unsupported.go
index 97d59614e..9db1e3c4b 100644
--- a/libpod/boltdb_state_unsupported.go
+++ b/libpod/boltdb_state_unsupported.go
@@ -1,5 +1,5 @@
-//go:build !linux
-// +build !linux
+//go:build !linux && !freebsd
+// +build !linux,!freebsd
package libpod
diff --git a/libpod/container_freebsd.go b/libpod/container_freebsd.go
new file mode 100644
index 000000000..f9fbc4daa
--- /dev/null
+++ b/libpod/container_freebsd.go
@@ -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:"-"`
+}
diff --git a/libpod/container_unsupported.go b/libpod/container_unsupported.go
index 5a46c163c..16bf11622 100644
--- a/libpod/container_unsupported.go
+++ b/libpod/container_unsupported.go
@@ -1,5 +1,5 @@
-//go:build !linux
-// +build !linux
+//go:build !linux && !freebsd
+// +build !linux,!freebsd
package libpod