From 1ffbbe798a238ac9f05bcb59fc4d61ddcdf20ca3 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 15 Sep 2023 12:56:42 +0200 Subject: [PATCH] vendor: github.com/containerd/containerd v1.6.24 full diff: https://github.com/containerd/containerd/compare/v1.6.22...v1.6.24 v1.6.24 release notes: full diff: https://github.com/containerd/containerd/compare/v1.6.23...v1.6.24 The twenty-fourth patch release for containerd 1.6 contains various fixes and updates. Notable Updates - CRI: fix leaked shim caused by high IO pressure - Update to go1.20.8 - Update runc to v1.1.9 - Backport: add configurable mount options to overlay snapshotter - log: cleanups and improvements to decouple more from logrus v1.6.23 release notes: full diff: https://github.com/containerd/containerd/compare/v1.6.22...v1.6.23 The twenty-third patch release for containerd 1.6 contains various fixes and updates. Notable Updates - Add stable ABI support in windows platform matcher + update hcsshim tag - cri: Don't use rel path for image volumes - Upgrade GitHub actions packages in release workflow - update to go1.19.12 - backport: ro option for userxattr mount check + cherry-pick: Fix ro mount option being passed Signed-off-by: Sebastiaan van Stijn --- cmd/dockerd/daemon.go | 2 +- cmd/dockerd/daemon_test.go | 2 +- cmd/dockerd/options.go | 3 +- daemon/config/config.go | 2 +- vendor.mod | 2 +- vendor.sum | 4 +- .../containerd/containerd/BUILDING.md | 2 +- .../containerd/containerd/Vagrantfile | 3 +- .../containerd/containerd/archive/tar.go | 1 + .../containerd/containerd/content/helpers.go | 4 +- .../containerd/content/local/store.go | 4 +- .../containerd/diff/walking/differ.go | 2 +- .../containerd/images/archive/importer.go | 1 + .../containerd/containerd/leases/id.go | 2 +- .../containerd/containerd/log/context.go | 158 ++++++++++++------ .../containerd/mount/losetup_linux.go | 4 +- .../containerd/pkg/randutil/randutil.go | 48 ++++++ .../containerd/platforms/defaults_windows.go | 26 ++- .../containerd/containerd/rootfs/apply.go | 2 +- .../snapshots/overlay/overlayutils/check.go | 1 + .../containerd/containerd/unpacker.go | 2 +- .../containerd/containerd/version/version.go | 2 +- vendor/modules.txt | 5 +- 23 files changed, 209 insertions(+), 73 deletions(-) create mode 100644 vendor/github.com/containerd/containerd/pkg/randutil/randutil.go diff --git a/cmd/dockerd/daemon.go b/cmd/dockerd/daemon.go index 41a4fc71e5..0e37415b2c 100644 --- a/cmd/dockerd/daemon.go +++ b/cmd/dockerd/daemon.go @@ -914,7 +914,7 @@ func systemContainerdRunning(honorXDG bool) (string, bool, error) { // configureDaemonLogs sets the logging level and formatting. It expects // the passed configuration to already be validated, and ignores invalid options. func configureDaemonLogs(conf *config.Config) { - switch conf.LogFormat { + switch log.OutputFormat(conf.LogFormat) { case log.JSONFormat: logrus.SetFormatter(&logrus.JSONFormatter{ TimestampFormat: log.RFC3339NanoFixed, diff --git a/cmd/dockerd/daemon_test.go b/cmd/dockerd/daemon_test.go index 3bc9d628d2..32d18ccd9e 100644 --- a/cmd/dockerd/daemon_test.go +++ b/cmd/dockerd/daemon_test.go @@ -165,7 +165,7 @@ func TestLoadDaemonCliConfigWithLogFormat(t *testing.T) { loadedConfig, err := loadDaemonCliConfig(opts) assert.NilError(t, err) assert.Assert(t, loadedConfig != nil) - assert.Check(t, is.Equal(log.JSONFormat, loadedConfig.LogFormat)) + assert.Check(t, is.Equal(log.JSONFormat, log.OutputFormat(loadedConfig.LogFormat))) } func TestLoadDaemonCliConfigWithInvalidLogFormat(t *testing.T) { diff --git a/cmd/dockerd/options.go b/cmd/dockerd/options.go index c272977932..d1773c9e30 100644 --- a/cmd/dockerd/options.go +++ b/cmd/dockerd/options.go @@ -107,8 +107,7 @@ func (o *daemonOptions) installFlags(flags *pflag.FlagSet) { flags.BoolVarP(&o.Debug, "debug", "D", false, "Enable debug mode") flags.BoolVar(&o.Validate, "validate", false, "Validate daemon configuration and exit") flags.StringVarP(&o.LogLevel, "log-level", "l", "info", `Set the logging level ("debug"|"info"|"warn"|"error"|"fatal")`) - flags.StringVar(&o.LogFormat, "log-format", log.TextFormat, - fmt.Sprintf(`Set the logging format ("%s"|"%s")`, log.TextFormat, log.JSONFormat)) + flags.StringVar(&o.LogFormat, "log-format", string(log.TextFormat), fmt.Sprintf(`Set the logging format ("%s"|"%s")`, log.TextFormat, log.JSONFormat)) flags.BoolVar(&o.TLS, FlagTLS, DefaultTLSValue, "Use TLS; implied by --tlsverify") flags.BoolVar(&o.TLSVerify, FlagTLSVerify, dockerTLSVerify || DefaultTLSValue, "Use TLS and verify the remote") diff --git a/daemon/config/config.go b/daemon/config/config.go index c0865a7ec9..0db6ea2f87 100644 --- a/daemon/config/config.go +++ b/daemon/config/config.go @@ -593,7 +593,7 @@ func Validate(config *Config) error { // validate log-format if logFormat := config.LogFormat; logFormat != "" { - switch logFormat { + switch log.OutputFormat(logFormat) { case log.TextFormat, log.JSONFormat: // These are valid default: diff --git a/vendor.mod b/vendor.mod index 92e01cb1b5..3f3af83310 100644 --- a/vendor.mod +++ b/vendor.mod @@ -26,7 +26,7 @@ require ( github.com/cloudflare/cfssl v1.6.4 github.com/container-orchestrated-devices/container-device-interface v0.6.1 github.com/containerd/cgroups/v3 v3.0.2 - github.com/containerd/containerd v1.6.22 + github.com/containerd/containerd v1.6.24 github.com/containerd/continuity v0.4.1 github.com/containerd/fifo v1.1.0 github.com/containerd/typeurl/v2 v2.1.1 diff --git a/vendor.sum b/vendor.sum index a18ba57aae..6ebb67d2e5 100644 --- a/vendor.sum +++ b/vendor.sum @@ -357,8 +357,8 @@ github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09Zvgq github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c= -github.com/containerd/containerd v1.6.22 h1:rGTIBxPJusM0evF6wKgIzuD+tV70nmx9eEjzHVm1JzI= -github.com/containerd/containerd v1.6.22/go.mod h1:BQAJdahvGz8xboAvxKg9hsDYIovn79Ea318anowQ1/o= +github.com/containerd/containerd v1.6.24 h1:HKF4bfN7WoCk+/n/hi3OrTKJlPWxZmeg1uVDRpEPlXA= +github.com/containerd/containerd v1.6.24/go.mod h1:06DkIUikjOcYdqFgOXDwBHO+qR4/qfbMPQ9XxtAGs1c= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= diff --git a/vendor/github.com/containerd/containerd/BUILDING.md b/vendor/github.com/containerd/containerd/BUILDING.md index 4f2196e6c2..286164dc26 100644 --- a/vendor/github.com/containerd/containerd/BUILDING.md +++ b/vendor/github.com/containerd/containerd/BUILDING.md @@ -14,7 +14,7 @@ This doc includes: To build the `containerd` daemon, and the `ctr` simple test client, the following build system dependencies are required: -* Go 1.13.x or above except 1.14.x +* Go 1.19.x or above * Protoc 3.x compiler and headers (download at the [Google protobuf releases page](https://github.com/protocolbuffers/protobuf/releases)) * Btrfs headers and libraries for your distribution. Note that building the btrfs driver can be disabled via the build tag `no_btrfs`, removing this dependency. diff --git a/vendor/github.com/containerd/containerd/Vagrantfile b/vendor/github.com/containerd/containerd/Vagrantfile index 95c3a359b4..71946f052b 100644 --- a/vendor/github.com/containerd/containerd/Vagrantfile +++ b/vendor/github.com/containerd/containerd/Vagrantfile @@ -70,6 +70,7 @@ Vagrant.configure("2") do |config| libselinux-devel \ lsof \ make \ + strace \ ${INSTALL_PACKAGES} SHELL end @@ -93,7 +94,7 @@ EOF config.vm.provision "install-golang", type: "shell", run: "once" do |sh| sh.upload_path = "/tmp/vagrant-install-golang" sh.env = { - 'GO_VERSION': ENV['GO_VERSION'] || "1.19.11", + 'GO_VERSION': ENV['GO_VERSION'] || "1.20.8", } sh.inline = <<~SHELL #!/usr/bin/env bash diff --git a/vendor/github.com/containerd/containerd/archive/tar.go b/vendor/github.com/containerd/containerd/archive/tar.go index cff0edca55..2023db3870 100644 --- a/vendor/github.com/containerd/containerd/archive/tar.go +++ b/vendor/github.com/containerd/containerd/archive/tar.go @@ -332,6 +332,7 @@ func createTarFile(ctx context.Context, path, extractDir string, hdr *tar.Header } } + //nolint:staticcheck // TypeRegA is deprecated but we may still receive an external tar with TypeRegA case tar.TypeReg, tar.TypeRegA: file, err := openFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, hdrInfo.Mode()) if err != nil { diff --git a/vendor/github.com/containerd/containerd/content/helpers.go b/vendor/github.com/containerd/containerd/content/helpers.go index 723c313917..23ddc452f8 100644 --- a/vendor/github.com/containerd/containerd/content/helpers.go +++ b/vendor/github.com/containerd/containerd/content/helpers.go @@ -21,12 +21,12 @@ import ( "errors" "fmt" "io" - "math/rand" "sync" "time" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" + "github.com/containerd/containerd/pkg/randutil" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) @@ -113,7 +113,7 @@ func OpenWriter(ctx context.Context, cs Ingester, opts ...WriterOpt) (Writer, er // error or abort. Requires asserting for an ingest manager select { - case <-time.After(time.Millisecond * time.Duration(rand.Intn(retry))): + case <-time.After(time.Millisecond * time.Duration(randutil.Intn(retry))): if retry < 2048 { retry = retry << 1 } diff --git a/vendor/github.com/containerd/containerd/content/local/store.go b/vendor/github.com/containerd/containerd/content/local/store.go index 0220028c4b..1b01790a5d 100644 --- a/vendor/github.com/containerd/containerd/content/local/store.go +++ b/vendor/github.com/containerd/containerd/content/local/store.go @@ -20,7 +20,6 @@ import ( "context" "fmt" "io" - "math/rand" "os" "path/filepath" "strconv" @@ -32,6 +31,7 @@ import ( "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/filters" "github.com/containerd/containerd/log" + "github.com/containerd/containerd/pkg/randutil" "github.com/sirupsen/logrus" "github.com/opencontainers/go-digest" @@ -473,7 +473,7 @@ func (s *store) Writer(ctx context.Context, opts ...content.WriterOpt) (content. lockErr = nil break } - time.Sleep(time.Millisecond * time.Duration(rand.Intn(1<