aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-04 13:34:41 +0200
committerGitHub <noreply@github.com>2022-09-04 13:34:41 +0200
commit8942a60bb012d2aa83f7d4ab1c05ec8e46df48a6 (patch)
treec80e70f956eb155abfd7785c78b48f52950d37f5
parente136bcc7c97ed9a7576417259cf93f7209f45dd2 (diff)
parentda57065abdcac276fd922b3e736517c9384ec20e (diff)
downloadpodman-8942a60bb012d2aa83f7d4ab1c05ec8e46df48a6.tar.gz
podman-8942a60bb012d2aa83f7d4ab1c05ec8e46df48a6.tar.bz2
podman-8942a60bb012d2aa83f7d4ab1c05ec8e46df48a6.zip
Merge pull request #15582 from dfr/freebsd-bind
Add support for FreeBSD volume mounts in specgen
-rw-r--r--libpod/define/mount.go2
-rw-r--r--libpod/define/mount_freebsd.go8
-rw-r--r--libpod/define/mount_linux.go8
-rw-r--r--libpod/define/mount_unsupported.go8
-rw-r--r--pkg/specgen/volumes.go3
5 files changed, 26 insertions, 3 deletions
diff --git a/libpod/define/mount.go b/libpod/define/mount.go
index 1b0d019c8..db444fd83 100644
--- a/libpod/define/mount.go
+++ b/libpod/define/mount.go
@@ -1,8 +1,6 @@
package define
const (
- // TypeBind is the type for mounting host dir
- TypeBind = "bind"
// TypeVolume is the type for named volumes
TypeVolume = "volume"
// TypeTmpfs is the type for mounting tmpfs
diff --git a/libpod/define/mount_freebsd.go b/libpod/define/mount_freebsd.go
new file mode 100644
index 000000000..e080c9ec6
--- /dev/null
+++ b/libpod/define/mount_freebsd.go
@@ -0,0 +1,8 @@
+//go:build freebsd
+
+package define
+
+const (
+ // TypeBind is the type for mounting host dir
+ TypeBind = "nullfs"
+)
diff --git a/libpod/define/mount_linux.go b/libpod/define/mount_linux.go
new file mode 100644
index 000000000..5ef848905
--- /dev/null
+++ b/libpod/define/mount_linux.go
@@ -0,0 +1,8 @@
+//go:build linux
+
+package define
+
+const (
+ // TypeBind is the type for mounting host dir
+ TypeBind = "bind"
+)
diff --git a/libpod/define/mount_unsupported.go b/libpod/define/mount_unsupported.go
new file mode 100644
index 000000000..cb8642fe2
--- /dev/null
+++ b/libpod/define/mount_unsupported.go
@@ -0,0 +1,8 @@
+//go:build !linux && !freebsd
+
+package define
+
+const (
+ // TypeBind is the type for mounting host dir
+ TypeBind = "bind"
+)
diff --git a/pkg/specgen/volumes.go b/pkg/specgen/volumes.go
index e70ed5b13..e71d14331 100644
--- a/pkg/specgen/volumes.go
+++ b/pkg/specgen/volumes.go
@@ -7,6 +7,7 @@ import (
"strings"
"github.com/containers/common/pkg/parse"
+ "github.com/containers/podman/v4/libpod/define"
spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/sirupsen/logrus"
)
@@ -159,7 +160,7 @@ func GenVolumeMounts(volumeFlag []string) (map[string]spec.Mount, map[string]*Na
} else {
newMount := spec.Mount{
Destination: dest,
- Type: "bind",
+ Type: define.TypeBind,
Source: src,
Options: options,
}