Skip to content

Commit

Permalink
Change default image volume mode to "nullfs" on FreeBSD
Browse files Browse the repository at this point in the history
This fixes a regression in
containers/podman#19241 which quite reasonably
assumed that the default image volume mode from pkg/config was correct.

Signed-off-by: Doug Rabson <dfr@rabson.org>
  • Loading branch information
dfr committed Jul 21, 2023
1 parent 6051c67 commit 1636199
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const (
BoltDBStateStore RuntimeStateStore = iota
)

var validImageVolumeModes = []string{"bind", "tmpfs", "ignore"}
var validImageVolumeModes = []string{_typeBind, "tmpfs", "ignore"}

// ProxyEnv is a list of Proxy Environment variables
var ProxyEnv = []string{
Expand Down
3 changes: 3 additions & 0 deletions pkg/config/config_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const (
// DefaultSignaturePolicyPath is the default value for the
// policy.json file.
DefaultSignaturePolicyPath = "/etc/containers/policy.json"

// Mount type for mounting host dir
_typeBind = "bind"
)

// podman remote clients on darwin cannot use unshare.isRootless() to determine the configuration file locations.
Expand Down
3 changes: 3 additions & 0 deletions pkg/config/config_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const (
// DefaultSignaturePolicyPath is the default value for the
// policy.json file.
DefaultSignaturePolicyPath = "/usr/local/etc/containers/policy.json"

// Mount type for mounting host dir
_typeBind = "nullfs"
)

// podman remote clients on freebsd cannot use unshare.isRootless() to determine the configuration file locations.
Expand Down
3 changes: 3 additions & 0 deletions pkg/config/config_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const (
// DefaultSignaturePolicyPath is the default value for the
// policy.json file.
DefaultSignaturePolicyPath = "/etc/containers/policy.json"

// Mount type for mounting host dir
_typeBind = "bind"
)

func selinuxEnabled() bool {
Expand Down
6 changes: 5 additions & 1 deletion pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ var _ = Describe("Config", func() {
gomega.Expect(defaultConfig.NetNS()).To(gomega.BeEquivalentTo("private"))
gomega.Expect(defaultConfig.IPCNS()).To(gomega.BeEquivalentTo("shareable"))
gomega.Expect(defaultConfig.Engine.InfraImage).To(gomega.BeEquivalentTo(""))
gomega.Expect(defaultConfig.Engine.ImageVolumeMode).To(gomega.BeEquivalentTo("bind"))
if runtime.GOOS == "freebsd" {
gomega.Expect(defaultConfig.Engine.ImageVolumeMode).To(gomega.BeEquivalentTo("nullfs"))
} else {
gomega.Expect(defaultConfig.Engine.ImageVolumeMode).To(gomega.BeEquivalentTo("bind"))
}
gomega.Expect(defaultConfig.Engine.SSHConfig).To(gomega.ContainSubstring("/.ssh/config"))
gomega.Expect(defaultConfig.Engine.EventsContainerCreateInspectData).To(gomega.BeFalse())
gomega.Expect(defaultConfig.Engine.DBBackend).To(gomega.BeEquivalentTo(stringBoltDB))
Expand Down
3 changes: 3 additions & 0 deletions pkg/config/config_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const (
// DefaultSignaturePolicyPath is the default value for the
// policy.json file.
DefaultSignaturePolicyPath = "/etc/containers/policy.json"

// Mount type for mounting host dir
_typeBind = "bind"
)

// podman remote clients on windows cannot use unshare.isRootless() to determine the configuration file locations.
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
_defaultTransport = "docker://"

// _defaultImageVolumeMode is a mode to handle built-in image volumes.
_defaultImageVolumeMode = "bind"
_defaultImageVolumeMode = _typeBind
)

var (
Expand Down

0 comments on commit 1636199

Please sign in to comment.