Vendor in latest c/common

Pull in updates made to the filters code for
images. Filters now perform an AND operation
except for th reference filter which does an
OR operation for positive case but an AND operation
for negative cases.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
This commit is contained in:
Urvashi Mohnani
2024-01-24 08:11:51 -05:00
parent d66b18f5af
commit 7c8c945496
197 changed files with 1521 additions and 1350 deletions

View File

@@ -13,12 +13,12 @@ import (
"github.com/containers/common/internal/attributedstring"
"github.com/containers/common/libnetwork/types"
"github.com/containers/common/pkg/capabilities"
"github.com/containers/common/pkg/util"
"github.com/containers/storage/pkg/ioutils"
"github.com/containers/storage/pkg/unshare"
units "github.com/docker/go-units"
selinux "github.com/opencontainers/selinux/go-selinux"
"github.com/sirupsen/logrus"
"golang.org/x/exp/slices"
)
const (
@@ -918,7 +918,7 @@ func (c *Config) GetDefaultEnvEx(envHost, httpProxy bool) []string {
}
// Capabilities returns the capabilities parses the Add and Drop capability
// list from the default capabiltiies for the container
// list from the default capabilities for the container
func (c *Config) Capabilities(user string, addCapabilities, dropCapabilities []string) ([]string, error) {
userNotRoot := func(user string) bool {
if user == "" || user == "root" || user == "0" {
@@ -1228,7 +1228,7 @@ func ValidateImageVolumeMode(mode string) error {
if mode == "" {
return nil
}
if util.StringInSlice(mode, validImageVolumeModes) {
if slices.Contains(validImageVolumeModes, mode) {
return nil
}
@@ -1245,7 +1245,7 @@ func (c *Config) FindInitBinary() (string, error) {
if c.Engine.InitPath != "" {
return c.Engine.InitPath, nil
}
// keep old default working to guarantee backwards comapt
// keep old default working to guarantee backwards compat
if _, err := os.Stat(DefaultInitPath); err == nil {
return DefaultInitPath, nil
}

View File

@@ -1,5 +1,4 @@
//go:build !remote
// +build !remote
package config
@@ -67,6 +66,13 @@ func (c *ContainersConfig) validateTZ() error {
"/etc/zoneinfo",
}
// Allow using TZDIR to override the lookupPaths. Ref:
// https://sourceware.org/git/?p=glibc.git;a=blob;f=time/tzfile.c;h=8a923d0cccc927a106dc3e3c641be310893bab4e;hb=HEAD#l149
tzdir := os.Getenv("TZDIR")
if tzdir != "" {
lookupPaths = []string{tzdir}
}
for _, paths := range lookupPaths {
zonePath := filepath.Join(paths, c.TZ)
if _, err := os.Stat(zonePath); err == nil {

View File

@@ -1,5 +1,4 @@
//go:build remote
// +build remote
package config

View File

@@ -1,5 +1,4 @@
//go:build !linux
// +build !linux
package config

View File

@@ -737,6 +737,15 @@ default_sysctls = [
# "/run/current-system/sw/bin/crun",
#]
#crun-vm = [
# "/usr/bin/crun-vm",
# "/usr/local/bin/crun-vm",
# "/usr/local/sbin/crun-vm",
# "/sbin/crun-vm",
# "/bin/crun-vm",
# "/run/current-system/sw/bin/crun-vm",
#]
#kata = [
# "/usr/bin/kata-runtime",
# "/usr/sbin/kata-runtime",

View File

@@ -295,9 +295,8 @@ func defaultMachineConfig() MachineConfig {
// defaultFarmConfig returns the default farms configuration.
func defaultFarmConfig() FarmConfig {
emptyList := make(map[string][]string)
return FarmConfig{
List: emptyList,
List: map[string][]string{},
}
}
@@ -340,7 +339,7 @@ func defaultEngineConfig() (*EngineConfig, error) {
c.HelperBinariesDir.Set(defaultHelperBinariesDir)
if additionalHelperBinariesDir != "" {
// Prioritize addtionalHelperBinariesDir over defaults.
// Prioritize additionalHelperBinariesDir over defaults.
c.HelperBinariesDir.Set(append([]string{additionalHelperBinariesDir}, c.HelperBinariesDir.Get()...))
}
c.HooksDir.Set(DefaultHooksDirs)
@@ -365,6 +364,14 @@ func defaultEngineConfig() (*EngineConfig, error) {
"/bin/crun",
"/run/current-system/sw/bin/crun",
},
"crun-vm": {
"/usr/bin/crun-vm",
"/usr/local/bin/crun-vm",
"/usr/local/sbin/crun-vm",
"/sbin/crun-vm",
"/bin/crun-vm",
"/run/current-system/sw/bin/crun-vm",
},
"crun-wasm": {
"/usr/bin/crun-wasm",
"/usr/sbin/crun-wasm",
@@ -556,7 +563,7 @@ func (c *Config) DNSServers() []string {
return c.Containers.DNSServers.Get()
}
// DNSSerches returns the default DNS searches to add to resolv.conf in containers.
// DNSSearches returns the default DNS searches to add to resolv.conf in containers.
func (c *Config) DNSSearches() []string {
return c.Containers.DNSSearches.Get()
}

View File

@@ -1,5 +1,4 @@
//go:build !freebsd
// +build !freebsd
package config

View File

@@ -1,5 +1,4 @@
//go:build !linux && !windows
// +build !linux,!windows
package config

View File

@@ -1,5 +1,4 @@
//go:build !systemd || !cgo
// +build !systemd !cgo
package config

View File

@@ -1,5 +1,4 @@
//go:build systemd && cgo
// +build systemd,cgo
package config