Update vendor dependencies

- Update github.com/containers/common to v0.64.1-0.20250806164630-57def9601f3b
- Update github.com/spf13/pflag to v1.0.7
- Update github.com/seccomp/libseccomp-golang to v0.11.1

Signed-off-by: Joshua Arrevillaga <2004jarrevillaga@gmail.com>
This commit is contained in:
Joshua Arrevillaga
2025-08-07 14:54:08 -04:00
parent a97d90c89b
commit e14b8acba8
24 changed files with 594 additions and 77 deletions

View File

@ -172,6 +172,9 @@ type ContainersConfig struct {
// LogDriver for the container. For example: k8s-file and journald
LogDriver string `toml:"log_driver,omitempty"`
// LogPath is the path to the container log file.
LogPath string `toml:"log_path,omitempty"`
// LogSizeMax is the maximum number of bytes after which the log file
// will be truncated. It can be expressed as a human-friendly string
// that is parsed to bytes.
@ -847,8 +850,7 @@ func (c *EngineConfig) Validate() error {
}
// Check if the pullPolicy from containers.conf is valid
// if it is invalid returns the error
pullPolicy := strings.ToLower(c.PullPolicy)
if _, err := ValidatePullPolicy(pullPolicy); err != nil {
if _, err := ParsePullPolicy(c.PullPolicy); err != nil {
return fmt.Errorf("invalid pull type from containers.conf %q: %w", c.PullPolicy, err)
}
@ -883,6 +885,10 @@ func (c *ContainersConfig) Validate() error {
return err
}
if err := c.validateLogPath(); err != nil {
return err
}
if c.LogSizeMax >= 0 && c.LogSizeMax < OCIBufSize {
return fmt.Errorf("log size max should be negative or >= %d", OCIBufSize)
}

View File

@ -105,6 +105,20 @@ func (c *ContainersConfig) validateUmask() error {
return nil
}
func (c *ContainersConfig) validateLogPath() error {
if c.LogPath == "" {
return nil
}
if !filepath.IsAbs(c.LogPath) {
return fmt.Errorf("log_path must be an absolute path - instead got %q", c.LogPath)
}
if strings.ContainsAny(c.LogPath, "\x00") {
return fmt.Errorf("log_path contains null bytes - got %q", c.LogPath)
}
return nil
}
func isRemote() bool {
return false
}

View File

@ -35,3 +35,7 @@ func (c *ContainersConfig) validateTZ() error {
func (c *ContainersConfig) validateUmask() error {
return nil
}
func (c *ContainersConfig) validateLogPath() error {
return nil
}

View File

@ -216,6 +216,14 @@ default_sysctls = [
#
#log_driver = "k8s-file"
# Default path for container logs to be stored in. When empty, logs will be stored
# in the container's default storage and removed when the container is removed.
# A subdirectory named with the container ID will be created under the specified
# path, and the log file will have the default name `ctr.log` within that directory.
# This option can be overridden by the `--log-opt` flag.
#
#log_path = ""
# Maximum size allowed for the container log file. Negative numbers indicate
# that no size limit is imposed. If positive, it must be >= 8192 to match or
# exceed conmon's read buffer. The file is truncated and re-opened so the

View File

@ -169,6 +169,14 @@ default_sysctls = [
#
#log_driver = "k8s-file"
# Default path for container logs to be stored in. When empty, logs will be stored
# in the container's default storage and removed when the container is removed.
# A subdirectory named with the container ID will be created under the specified
# path, and the log file will have the default name `ctr.log` within that directory.
# This option can be overridden by the `--log-opt` flag.
#
#log_path = ""
# Maximum size allowed for the container log file. Negative numbers indicate
# that no size limit is imposed. If positive, it must be >= 8192 to match or
# exceed conmon's read buffer. The file is truncated and re-opened so the

View File

@ -87,8 +87,3 @@ func ParsePullPolicy(s string) (PullPolicy, error) {
return PullPolicyUnsupported, fmt.Errorf("unsupported pull policy %q", s)
}
}
// Deprecated: please use `ParsePullPolicy` instead.
func ValidatePullPolicy(s string) (PullPolicy, error) {
return ParsePullPolicy(s)
}

View File

@ -93,9 +93,9 @@ func PrepareFilters(r *http.Request) (map[string][]string, error) {
}
filterMap := map[string][]string{}
for _, filter := range filtersList {
split := strings.SplitN(filter, "=", 2)
if len(split) > 1 {
filterMap[split[0]] = append(filterMap[split[0]], split[1])
key, val, found := strings.Cut(filter, "=")
if found {
filterMap[key] = append(filterMap[key], val)
}
}
return filterMap, nil
@ -105,7 +105,7 @@ func PrepareFilters(r *http.Request) (map[string][]string, error) {
func MatchLabelFilters(filterValues []string, labels map[string]string) bool {
outer:
for _, filterValue := range filterValues {
filterKey, filterValue := splitFilterValue(filterValue)
filterKey, filterValue, _ := strings.Cut(filterValue, "=")
for labelKey, labelValue := range labels {
if filterValue == "" || labelValue == filterValue {
if labelKey == filterKey || matchPattern(filterKey, labelKey) {
@ -121,7 +121,7 @@ outer:
// MatchNegatedLabelFilters matches negated labels and returns true if they are valid
func MatchNegatedLabelFilters(filterValues []string, labels map[string]string) bool {
for _, filterValue := range filterValues {
filterKey, filterValue := splitFilterValue(filterValue)
filterKey, filterValue, _ := strings.Cut(filterValue, "=")
for labelKey, labelValue := range labels {
if filterValue == "" || labelValue == filterValue {
if labelKey == filterKey || matchPattern(filterKey, labelKey) {
@ -133,17 +133,6 @@ func MatchNegatedLabelFilters(filterValues []string, labels map[string]string) b
return true
}
func splitFilterValue(filterValue string) (string, string) {
filterArray := strings.SplitN(filterValue, "=", 2)
filterKey := filterArray[0]
if len(filterArray) > 1 {
filterValue = filterArray[1]
} else {
filterValue = ""
}
return filterKey, filterValue
}
func matchPattern(pattern string, value string) bool {
if strings.Contains(pattern, "*") {
filter := fmt.Sprintf("*%s*", pattern)

View File

@ -5,7 +5,6 @@ import (
"os"
"path/filepath"
"regexp"
"slices"
"time"
"github.com/containers/storage/pkg/fileutils"
@ -13,13 +12,6 @@ import (
"github.com/sirupsen/logrus"
)
// StringInSlice determines if a string is in a string slice, returns bool.
//
// Deprecated: Use [slices.Contains] instead.
func StringInSlice(s string, sl []string) bool {
return slices.Contains(sl, s)
}
// StringMatchRegexSlice determines if a given string matches one of the given regexes, returns bool
func StringMatchRegexSlice(s string, re []string) bool {
for _, r := range re {

View File

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