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)
}