vendor containers/common@main

Also adjust the e2e tests to account for SYS_CHROOT having made it back
to the default caps.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2023-03-23 15:09:32 +01:00
parent cb18a33f63
commit 5f86fae71f
8 changed files with 31 additions and 17 deletions

View File

@@ -765,11 +765,21 @@ func addConfigs(dirPath string, configs []string) ([]string, error) {
// Returns the list of configuration files, if they exist in order of hierarchy.
// The files are read in order and each new file can/will override previous
// file settings.
func systemConfigs() ([]string, error) {
var err error
configs := []string{}
path := os.Getenv("CONTAINERS_CONF")
if path != "" {
func systemConfigs() (configs []string, finalErr error) {
if path := os.Getenv("CONTAINERS_CONF_OVERRIDE"); path != "" {
if _, err := os.Stat(path); err != nil {
return nil, fmt.Errorf("CONTAINERS_CONF_OVERRIDE file: %w", err)
}
// Add the override config last to make sure it can override any
// previous settings.
defer func() {
if finalErr == nil {
configs = append(configs, path)
}
}()
}
if path := os.Getenv("CONTAINERS_CONF"); path != "" {
if _, err := os.Stat(path); err != nil {
return nil, fmt.Errorf("CONTAINERS_CONF file: %w", err)
}
@@ -781,12 +791,14 @@ func systemConfigs() ([]string, error) {
if _, err := os.Stat(OverrideContainersConfig); err == nil {
configs = append(configs, OverrideContainersConfig)
}
var err error
configs, err = addConfigs(OverrideContainersConfig+".d", configs)
if err != nil {
return nil, err
}
path, err = ifRootlessConfigPath()
path, err := ifRootlessConfigPath()
if err != nil {
return nil, err
}

View File

@@ -68,6 +68,7 @@
# "SETGID",
# "SETPCAP",
# "SETUID",
# "SYS_CHROOT",
#]
# A list of sysctls to be set in containers by default,

View File

@@ -60,6 +60,7 @@ var (
"CAP_SETGID",
"CAP_SETPCAP",
"CAP_SETUID",
"CAP_SYS_CHROOT",
}
// Search these locations in which CNIPlugins can be installed.

View File

@@ -1,4 +1,4 @@
package version
// Version is the version of the build.
const Version = "0.51.1-dev"
const Version = "0.52.0-dev"