Bump containers/common to latest main

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon
2024-01-29 16:30:55 -05:00
parent 174631f726
commit d202acd861
56 changed files with 1930 additions and 1119 deletions

View File

@@ -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{
@@ -154,6 +154,13 @@ type ContainersConfig struct {
// Deprecated: Do not use this field directly use conf.FindInitBinary() instead.
InitPath string `toml:"init_path,omitempty"`
// InterfaceName tells container runtimes how to set interface names
// inside containers.
// The only valid value at the moment is "device" that indicates the
// interface name should be set as the network_interface name from
// the network config.
InterfaceName string `toml:"interface_name,omitempty"`
// IPCNS way to create a ipc namespace for the container
IPCNS string `toml:"ipcns,omitempty"`
@@ -814,6 +821,10 @@ func (c *ContainersConfig) Validate() error {
return err
}
if err := c.validateInterfaceName(); err != nil {
return err
}
if err := c.validateTZ(); err != nil {
return err
}

View File

@@ -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.

View File

@@ -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.

View File

@@ -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 {

View File

@@ -42,6 +42,14 @@ func (c *ContainersConfig) validateDevices() error {
return nil
}
func (c *ContainersConfig) validateInterfaceName() error {
if c.InterfaceName == "device" || c.InterfaceName == "" {
return nil
}
return fmt.Errorf("invalid interface_name option %s", c.InterfaceName)
}
func (c *ContainersConfig) validateUlimits() error {
for _, u := range c.DefaultUlimits.Get() {
ul, err := units.ParseUlimit(u)

View File

@@ -20,6 +20,10 @@ func (c *ContainersConfig) validateDevices() error {
return nil
}
func (c *ContainersConfig) validateInterfaceName() error {
return nil
}
func (c *ContainersConfig) validateUlimits() error {
return nil
}

View File

@@ -164,6 +164,13 @@ default_sysctls = [
#
#ipcns = "shareable"
# Default way to set an interface name inside container. Defaults to legacy
# pattern of ethX, where X is a integer, when left undefined.
# Options are:
# "device" Uses the network_interface name from the network config as interface name.
# Falls back to the ethX pattern if the network_interface is not set.
#interface_name = ""
# keyring tells the container engine whether to create
# a kernel keyring for use within the container.
#
@@ -341,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.
@@ -549,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

View File

@@ -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"