From 610250f06e5a6e300e0ef57e86a0c467b0f5c834 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 30 Jan 2023 09:07:59 +0100 Subject: [PATCH] vendor: github.com/containerd/containerd v1.6.16 Notable Updates - Fix push error propagation - Fix slice append error with HugepageLimits for Linux - Update default seccomp profile for PKU and CAP_SYS_NICE - Fix overlayfs error when upperdirlabel option is set full diff: https://github.com/containerd/containerd/compare/v1.6.15...v1.6.16 Signed-off-by: Sebastiaan van Stijn (cherry picked from commit c41c8c2f865893f06f6ca58604a0288e0e20476f) Signed-off-by: Sebastiaan van Stijn --- vendor.mod | 2 +- vendor.sum | 4 +- .../containerd/containerd/Vagrantfile | 20 +++++----- .../containerd/remotes/docker/pusher.go | 40 ++++++++++--------- .../containerd/containerd/version/version.go | 2 +- vendor/modules.txt | 2 +- 6 files changed, 38 insertions(+), 32 deletions(-) diff --git a/vendor.mod b/vendor.mod index 8acbec19891a1..fb6bd1f1ef7cd 100644 --- a/vendor.mod +++ b/vendor.mod @@ -19,7 +19,7 @@ require ( github.com/bsphere/le_go v0.0.0-20200109081728-fc06dab2caa8 github.com/cloudflare/cfssl v0.0.0-20180323000720-5d63dbd981b5 github.com/containerd/cgroups v1.0.4 - github.com/containerd/containerd v1.6.15 + github.com/containerd/containerd v1.6.16 github.com/containerd/continuity v0.3.0 github.com/containerd/fifo v1.0.0 github.com/containerd/typeurl v1.0.2 diff --git a/vendor.sum b/vendor.sum index affa35222a614..247f2890283d9 100644 --- a/vendor.sum +++ b/vendor.sum @@ -261,8 +261,8 @@ github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTV github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c= github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s= github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE= -github.com/containerd/containerd v1.6.15 h1:4wWexxzLNHNE46aIETc6ge4TofO550v+BlLoANrbses= -github.com/containerd/containerd v1.6.15/go.mod h1:U2NnBPIhzJDm59xF7xB2MMHnKtggpZ+phKg8o2TKj2c= +github.com/containerd/containerd v1.6.16 h1:0H5xH6ABsN7XTrxIAKxFpBkFCBtrZ/OSORhCpUnHjrc= +github.com/containerd/containerd v1.6.16/go.mod h1:1RdCUu95+gc2v9t3IL+zIlpClSmew7/0YS8O5eQZrOw= 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/Vagrantfile b/vendor/github.com/containerd/containerd/Vagrantfile index 24056127bda69..2af802f278be0 100644 --- a/vendor/github.com/containerd/containerd/Vagrantfile +++ b/vendor/github.com/containerd/containerd/Vagrantfile @@ -17,7 +17,7 @@ # Vagrantfile for Fedora and EL Vagrant.configure("2") do |config| - config.vm.box = ENV["BOX"] || "fedora/36-cloud-base" + config.vm.box = ENV["BOX"] || "fedora/37-cloud-base" config.vm.box_version = ENV["BOX_VERSION"] memory = 4096 cpus = 2 @@ -30,6 +30,8 @@ Vagrant.configure("2") do |config| v.cpus = cpus end + config.vm.synced_folder ".", "/vagrant", type: "rsync" + # Disabled by default. To run: # vagrant up --provision-with=upgrade-packages # To upgrade only specific packages: @@ -91,7 +93,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.18.9", + 'GO_VERSION': ENV['GO_VERSION'] || "1.18.10", } sh.inline = <<~SHELL #!/usr/bin/env bash @@ -146,7 +148,8 @@ EOF source /etc/environment source /etc/profile.d/sh.local set -eux -o pipefail - ${GOPATH}/src/github.com/containerd/containerd/script/setup/install-cni + cd ${GOPATH}/src/github.com/containerd/containerd + script/setup/install-cni PATH=/opt/cni/bin:$PATH type ${CNI_BINARIES} || true SHELL end @@ -212,8 +215,8 @@ EOF SHELL end - # SELinux is permissive by default (via provisioning) in this VM. To re-run with SELinux enforcing: - # vagrant up --provision-with=selinux-enforcing,test-integration + # SELinux is Enforcing by default (via provisioning) in this VM. To re-run with SELinux disabled: + # SELINUX=Disabled vagrant up --provision-with=selinux,test-integration # config.vm.provision "test-integration", type: "shell", run: "never" do |sh| sh.upload_path = "/tmp/test-integration" @@ -234,8 +237,8 @@ EOF SHELL end - # SELinux is permissive by default (via provisioning) in this VM. To re-run with SELinux enforcing: - # vagrant up --provision-with=selinux-enforcing,test-cri + # SELinux is Enforcing by default (via provisioning) in this VM. To re-run with SELinux disabled: + # SELINUX=Disabled vagrant up --provision-with=selinux,test-cri # config.vm.provision "test-cri", type: "shell", run: "never" do |sh| sh.upload_path = "/tmp/test-cri" @@ -253,6 +256,7 @@ EOF function cleanup() { journalctl -u containerd > /tmp/containerd.log + cat /tmp/containerd.log systemctl stop containerd } selinux=$(getenforce) @@ -291,8 +295,6 @@ EOF [registries.search] registries = ['docker.io'] EOF - # Disable SELinux to allow overlayfs - setenforce 0 SHELL end diff --git a/vendor/github.com/containerd/containerd/remotes/docker/pusher.go b/vendor/github.com/containerd/containerd/remotes/docker/pusher.go index 56d60efe93b0f..bef77fa61d56c 100644 --- a/vendor/github.com/containerd/containerd/remotes/docker/pusher.go +++ b/vendor/github.com/containerd/containerd/remotes/docker/pusher.go @@ -377,17 +377,24 @@ func (pw *pushWriter) Write(p []byte) (n int, err error) { // If content has already been written, the bytes // cannot be written and the caller must reset - if status.Offset > 0 { - status.Offset = 0 - status.UpdatedAt = time.Now() - pw.tracker.SetStatus(pw.ref, status) - return 0, content.ErrReset - } + status.Offset = 0 + status.UpdatedAt = time.Now() + pw.tracker.SetStatus(pw.ref, status) + return 0, content.ErrReset default: } } n, err = pw.pipe.Write(p) + if errors.Is(err, io.ErrClosedPipe) { + // if the pipe is closed, we might have the original error on the error + // channel - so we should try and get it + select { + case err2 := <-pw.errC: + err = err2 + default: + } + } status.Offset += int64(n) status.UpdatedAt = time.Now() pw.tracker.SetStatus(pw.ref, status) @@ -428,7 +435,7 @@ func (pw *pushWriter) Digest() digest.Digest { func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Digest, opts ...content.Opt) error { // Check whether read has already thrown an error - if _, err := pw.pipe.Write([]byte{}); err != nil && err != io.ErrClosedPipe { + if _, err := pw.pipe.Write([]byte{}); err != nil && !errors.Is(err, io.ErrClosedPipe) { return fmt.Errorf("pipe error before commit: %w", err) } @@ -439,9 +446,7 @@ func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Di var resp *http.Response select { case err := <-pw.errC: - if err != nil { - return err - } + return err case resp = <-pw.respC: defer resp.Body.Close() case p, ok := <-pw.pipeC: @@ -453,18 +458,17 @@ func (pw *pushWriter) Commit(ctx context.Context, size int64, expected digest.Di } pw.pipe.CloseWithError(content.ErrReset) pw.pipe = p + + // If content has already been written, the bytes + // cannot be written again and the caller must reset status, err := pw.tracker.GetStatus(pw.ref) if err != nil { return err } - // If content has already been written, the bytes - // cannot be written again and the caller must reset - if status.Offset > 0 { - status.Offset = 0 - status.UpdatedAt = time.Now() - pw.tracker.SetStatus(pw.ref, status) - return content.ErrReset - } + status.Offset = 0 + status.UpdatedAt = time.Now() + pw.tracker.SetStatus(pw.ref, status) + return content.ErrReset } // 201 is specified return status, some registries return diff --git a/vendor/github.com/containerd/containerd/version/version.go b/vendor/github.com/containerd/containerd/version/version.go index 7246cc0b13a06..ee6b711c7e8fb 100644 --- a/vendor/github.com/containerd/containerd/version/version.go +++ b/vendor/github.com/containerd/containerd/version/version.go @@ -23,7 +23,7 @@ var ( Package = "github.com/containerd/containerd" // Version holds the complete version number. Filled in at linking time. - Version = "1.6.15+unknown" + Version = "1.6.16+unknown" // Revision is filled with the VCS (e.g. git) revision being used to build // the program at linking time. diff --git a/vendor/modules.txt b/vendor/modules.txt index ec2d7ab2afd21..b52ed1bc940d2 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -160,7 +160,7 @@ github.com/containerd/cgroups/v2/stats # github.com/containerd/console v1.0.3 ## explicit; go 1.13 github.com/containerd/console -# github.com/containerd/containerd v1.6.15 +# github.com/containerd/containerd v1.6.16 ## explicit; go 1.17 github.com/containerd/containerd github.com/containerd/containerd/api/events