Skip to content

Commit

Permalink
Merge pull request #1820 from mheon/no_bind_image_vols
Browse files Browse the repository at this point in the history
Change default image volume mode to "anonymous"
  • Loading branch information
openshift-merge-bot[bot] authored Jan 29, 2024
2 parents 179239a + 92e64c4 commit c1732f2
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
bindirPrefix = "$BINDIR"
)

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

// ProxyEnv is a list of Proxy Environment variables
var ProxyEnv = []string{
Expand Down
3 changes: 0 additions & 3 deletions pkg/config/config_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ 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: 0 additions & 3 deletions pkg/config/config_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ 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: 0 additions & 3 deletions pkg/config/config_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ 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: 1 addition & 5 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ 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(""))
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.ImageVolumeMode).To(gomega.BeEquivalentTo("anonymous"))
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.Equal(""))
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/containers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ default_sysctls = [
#]

# The firewall driver to be used by netavark.
# The default is empty which means netavark will pick one accordingly. Current supported
# The default is empty which means netavark will pick one accordingly. Current supported
# drivers are "iptables", "none" (no firewall rules will be created) and "firewalld" (firewalld is
# experimental at the moment and not recommend outside of testing). In the future we are
# planning to add support for a "nftables" driver.
Expand Down Expand Up @@ -556,7 +556,7 @@ default_sysctls = [
#image_parallel_copies = 0

# Tells container engines how to handle the built-in image volumes.
# * bind: An anonymous named volume will be created and mounted
# * anonymous: An anonymous named volume will be created and mounted
# into the container.
# * tmpfs: The volume is mounted onto the container as a tmpfs,
# which allows users to create content that disappears when
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const (
_defaultTransport = "docker://"

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

// defaultInitName is the default name of the init binary
defaultInitName = "catatonit"
Expand Down

0 comments on commit c1732f2

Please sign in to comment.