From 3249973d37538206f6bb9e1154d2f9d89a14bd79 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 16:31:39 +0000 Subject: [PATCH] fix(deps): update module github.com/containers/storage to v1.49.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 +++---- .../github.com/containers/storage/.cirrus.yml | 2 +- vendor/github.com/containers/storage/Makefile | 2 +- vendor/github.com/containers/storage/VERSION | 2 +- .../containers/storage/drivers/btrfs/btrfs.go | 3 +-- .../storage/drivers/overlay/overlay.go | 14 +++++++---- .../storage/drivers/quota/projectquota.go | 24 ++++++++++++------- .../storage/pkg/chunked/storage_linux.go | 20 ---------------- .../pkg/chunked/storage_unsupported.go | 7 ------ vendor/github.com/containers/storage/store.go | 1 + .../runc/libcontainer/user/user.go | 2 +- vendor/modules.txt | 4 ++-- 13 files changed, 39 insertions(+), 54 deletions(-) diff --git a/go.mod b/go.mod index 0f0123931c..933dd4100a 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/containers/common v0.55.3 github.com/containers/image/v5 v5.27.1-0.20230814071742-35192da58823 github.com/containers/ocicrypt v1.1.8 - github.com/containers/storage v1.48.1-0.20230728131509-c3da76fa3f63 + github.com/containers/storage v1.49.0 github.com/docker/distribution v2.8.2+incompatible github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.1.0-rc4 @@ -82,7 +82,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/oklog/ulid v1.3.1 // indirect - github.com/opencontainers/runc v1.1.8 // indirect + github.com/opencontainers/runc v1.1.9 // indirect github.com/opencontainers/runtime-spec v1.1.0 // indirect github.com/opencontainers/selinux v1.11.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect diff --git a/go.sum b/go.sum index 57d3532aa5..3e27311e32 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,8 @@ github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYgle github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY= github.com/containers/ocicrypt v1.1.8 h1:saSBF0/8DyPUjzcxMVzL2OBUWCkvRvqIm75pu0ADSZk= github.com/containers/ocicrypt v1.1.8/go.mod h1:jM362hyBtbwLMWzXQZTlkjKGAQf/BN/LFMtH0FIRt34= -github.com/containers/storage v1.48.1-0.20230728131509-c3da76fa3f63 h1:oHER814v4p86QDV9EKZRSaMmEeC8yWD2wXlFAige1kc= -github.com/containers/storage v1.48.1-0.20230728131509-c3da76fa3f63/go.mod h1:m9LC8fEm9FcuJ4wOJHYmCqdQUb0f66850wXyen+hh78= +github.com/containers/storage v1.49.0 h1:7Vqj8OKlwlcWZ4U61+eS2bNwyIG/qXQo/UZVW5kXn74= +github.com/containers/storage v1.49.0/go.mod h1:fCvGMWQ0BOvlReQf9DqRAcl73ofTfRXE8l6ifnI4a3g= github.com/coreos/go-oidc/v3 v3.6.0 h1:AKVxfYw1Gmkn/w96z0DbT/B/xFnzTd3MkZvWLjF4n/o= github.com/coreos/go-oidc/v3 v3.6.0/go.mod h1:ZpHUsHBucTUj6WOkrP4E20UPynbLZzhTQ1XKCXkxyPc= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -272,8 +272,8 @@ github.com/opencontainers/image-spec v1.1.0-rc4 h1:oOxKUJWnFC4YGHCCMNql1x4YaDfYB github.com/opencontainers/image-spec v1.1.0-rc4/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opencontainers/image-tools v1.0.0-rc3 h1:ZR837lBIxq6mmwEqfYrbLMuf75eBSHhccVHy6lsBeM4= github.com/opencontainers/image-tools v1.0.0-rc3/go.mod h1:A9btVpZLzttF4iFaKNychhPyrhfOjJ1OF5KrA8GcLj4= -github.com/opencontainers/runc v1.1.8 h1:zICRlc+C1XzivLc3nzE+cbJV4LIi8tib6YG0MqC6OqA= -github.com/opencontainers/runc v1.1.8/go.mod h1:CbUumNnWCuTGFukNXahoo/RFBZvDAgRh/smNYNOhA50= +github.com/opencontainers/runc v1.1.9 h1:XR0VIHTGce5eWPkaPesqTBrhW2yAcaraWfsEalNwQLM= +github.com/opencontainers/runc v1.1.9/go.mod h1:CbUumNnWCuTGFukNXahoo/RFBZvDAgRh/smNYNOhA50= github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU= diff --git a/vendor/github.com/containers/storage/.cirrus.yml b/vendor/github.com/containers/storage/.cirrus.yml index 8ef38e2cd2..00c69d7f12 100644 --- a/vendor/github.com/containers/storage/.cirrus.yml +++ b/vendor/github.com/containers/storage/.cirrus.yml @@ -23,7 +23,7 @@ env: # GCE project where images live IMAGE_PROJECT: "libpod-218412" # VM Image built in containers/automation_images - IMAGE_SUFFIX: "c20230614t132754z-f38f37d13" + IMAGE_SUFFIX: "c20230816t191118z-f38f37d13" FEDORA_CACHE_IMAGE_NAME: "fedora-${IMAGE_SUFFIX}" DEBIAN_CACHE_IMAGE_NAME: "debian-${IMAGE_SUFFIX}" diff --git a/vendor/github.com/containers/storage/Makefile b/vendor/github.com/containers/storage/Makefile index 6cb354c2c0..77189d49ea 100644 --- a/vendor/github.com/containers/storage/Makefile +++ b/vendor/github.com/containers/storage/Makefile @@ -49,7 +49,7 @@ local-gccgo gccgo: ## build using gccgo on the host GCCGO=$(PWD)/hack/gccgo-wrapper.sh $(GO) build -compiler gccgo $(BUILDFLAGS) -o containers-storage.gccgo ./cmd/containers-storage local-cross cross: ## cross build the binaries for arm, darwin, and freebsd - @for target in linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64 linux/ppc64le linux/s390x linux/mips linux/mipsle linux/mips64 linux/mips64le darwin/amd64 windows/amd64 freebsd/amd64 freebsd/arm64 ; do \ + @for target in linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64 linux/ppc64le linux/riscv64 linux/s390x linux/mips linux/mipsle linux/mips64 linux/mips64le darwin/amd64 windows/amd64 freebsd/amd64 freebsd/arm64 ; do \ os=`echo $${target} | cut -f1 -d/` ; \ arch=`echo $${target} | cut -f2 -d/` ; \ suffix=$${os}.$${arch} ; \ diff --git a/vendor/github.com/containers/storage/VERSION b/vendor/github.com/containers/storage/VERSION index a6cb1f763b..7f3a46a841 100644 --- a/vendor/github.com/containers/storage/VERSION +++ b/vendor/github.com/containers/storage/VERSION @@ -1 +1 @@ -1.49.0-dev +1.49.0 diff --git a/vendor/github.com/containers/storage/drivers/btrfs/btrfs.go b/vendor/github.com/containers/storage/drivers/btrfs/btrfs.go index 42d55c1a73..fd93d4e84d 100644 --- a/vendor/github.com/containers/storage/drivers/btrfs/btrfs.go +++ b/vendor/github.com/containers/storage/drivers/btrfs/btrfs.go @@ -675,8 +675,7 @@ func (d *Driver) Exists(id string) bool { // List all of the layers known to the driver. func (d *Driver) ListLayers() ([]string, error) { - subvolumesDir := filepath.Join(d.home, "subvolumes") - entries, err := os.ReadDir(subvolumesDir) + entries, err := os.ReadDir(d.subvolumesDir()) if err != nil { return nil, err } diff --git a/vendor/github.com/containers/storage/drivers/overlay/overlay.go b/vendor/github.com/containers/storage/drivers/overlay/overlay.go index 6b6f20637d..807b81d374 100644 --- a/vendor/github.com/containers/storage/drivers/overlay/overlay.go +++ b/vendor/github.com/containers/storage/drivers/overlay/overlay.go @@ -820,11 +820,17 @@ func (d *Driver) String() string { // Status returns current driver information in a two dimensional string array. // Output contains "Backing Filesystem" used in this implementation. func (d *Driver) Status() [][2]string { + supportsVolatile, err := d.getSupportsVolatile() + if err != nil { + supportsVolatile = false + } return [][2]string{ {"Backing Filesystem", backingFs}, {"Supports d_type", strconv.FormatBool(d.supportsDType)}, {"Native Overlay Diff", strconv.FormatBool(!d.useNaiveDiff())}, {"Using metacopy", strconv.FormatBool(d.usingMetacopy)}, + {"Supports shifting", strconv.FormatBool(d.SupportsShifting())}, + {"Supports volatile", strconv.FormatBool(supportsVolatile)}, } } @@ -1879,7 +1885,9 @@ func (d *Driver) Put(id string) error { if !unmounted { if err := unix.Unmount(mountpoint, unix.MNT_DETACH); err != nil && !os.IsNotExist(err) { logrus.Debugf("Failed to unmount %s overlay: %s - %v", id, mountpoint, err) - return fmt.Errorf("unmounting %q: %w", mountpoint, err) + if !errors.Is(err, unix.EINVAL) { + return fmt.Errorf("unmounting %q: %w", mountpoint, err) + } } } @@ -2162,10 +2170,6 @@ func (d *Driver) getLowerDiffPaths(id string) ([]string, error) { // and its parent and returns the size in bytes of the changes // relative to its base filesystem directory. func (d *Driver) DiffSize(id string, idMappings *idtools.IDMappings, parent string, parentMappings *idtools.IDMappings, mountLabel string) (size int64, err error) { - if d.options.mountProgram == "" && (d.useNaiveDiff() || !d.isParent(id, parent)) { - return d.naiveDiff.DiffSize(id, idMappings, parent, parentMappings, mountLabel) - } - p, err := d.getDiffPath(id) if err != nil { return 0, err diff --git a/vendor/github.com/containers/storage/drivers/quota/projectquota.go b/vendor/github.com/containers/storage/drivers/quota/projectquota.go index 10ea3c5a56..2be79698d3 100644 --- a/vendor/github.com/containers/storage/drivers/quota/projectquota.go +++ b/vendor/github.com/containers/storage/drivers/quota/projectquota.go @@ -58,6 +58,7 @@ import ( "os" "path" "path/filepath" + "sync" "syscall" "unsafe" @@ -83,7 +84,7 @@ type Quota struct { type Control struct { backingFsBlockDev string nextProjectID uint32 - quotas map[string]uint32 + quotas *sync.Map basePath string } @@ -168,7 +169,7 @@ func NewControl(basePath string) (*Control, error) { q := Control{ backingFsBlockDev: backingFsBlockDev, nextProjectID: minProjectID + 1, - quotas: make(map[string]uint32), + quotas: &sync.Map{}, basePath: basePath, } @@ -191,7 +192,11 @@ func NewControl(basePath string) (*Control, error) { // SetQuota - assign a unique project id to directory and set the quota limits // for that project id func (q *Control) SetQuota(targetPath string, quota Quota) error { - projectID, ok := q.quotas[targetPath] + var projectID uint32 + value, ok := q.quotas.Load(targetPath) + if ok { + projectID, ok = value.(uint32) + } if !ok { projectID = q.nextProjectID @@ -203,7 +208,7 @@ func (q *Control) SetQuota(targetPath string, quota Quota) error { return err } - q.quotas[targetPath] = projectID + q.quotas.Store(targetPath, projectID) q.nextProjectID++ } @@ -217,7 +222,7 @@ func (q *Control) SetQuota(targetPath string, quota Quota) error { // ClearQuota removes the map entry in the quotas map for targetPath. // It does so to prevent the map leaking entries as directories are deleted. func (q *Control) ClearQuota(targetPath string) { - delete(q.quotas, targetPath) + q.quotas.Delete(targetPath) } // setProjectQuota - set the quota for project id on xfs block device @@ -297,8 +302,11 @@ func (q *Control) GetDiskUsage(targetPath string, usage *directory.DiskUsage) er func (q *Control) fsDiskQuotaFromPath(targetPath string) (C.fs_disk_quota_t, error) { var d C.fs_disk_quota_t - - projectID, ok := q.quotas[targetPath] + var projectID uint32 + value, ok := q.quotas.Load(targetPath) + if ok { + projectID, ok = value.(uint32) + } if !ok { return d, fmt.Errorf("quota not found for path : %s", targetPath) } @@ -380,7 +388,7 @@ func (q *Control) findNextProjectID() error { return err } if projid > 0 { - q.quotas[path] = projid + q.quotas.Store(path, projid) } if q.nextProjectID <= projid { q.nextProjectID = projid + 1 diff --git a/vendor/github.com/containers/storage/pkg/chunked/storage_linux.go b/vendor/github.com/containers/storage/pkg/chunked/storage_linux.go index 36abe27730..088c92782c 100644 --- a/vendor/github.com/containers/storage/pkg/chunked/storage_linux.go +++ b/vendor/github.com/containers/storage/pkg/chunked/storage_linux.go @@ -164,26 +164,6 @@ func copyFileContent(srcFd int, destFile string, dirfd int, mode os.FileMode, us return dstFile, st.Size(), nil } -// GetTOCDigest returns the digest of the TOC as recorded in the annotations. -// This is an experimental feature and may be changed/removed in the future. -func GetTOCDigest(annotations map[string]string) (*digest.Digest, error) { - if contentDigest, ok := annotations[estargz.TOCJSONDigestAnnotation]; ok { - d, err := digest.Parse(contentDigest) - if err != nil { - return nil, err - } - return &d, nil - } - if contentDigest, ok := annotations[internal.ManifestChecksumKey]; ok { - d, err := digest.Parse(contentDigest) - if err != nil { - return nil, err - } - return &d, nil - } - return nil, nil -} - type seekableFile struct { file *os.File } diff --git a/vendor/github.com/containers/storage/pkg/chunked/storage_unsupported.go b/vendor/github.com/containers/storage/pkg/chunked/storage_unsupported.go index cc37ab1d8f..8d3fcf2ba4 100644 --- a/vendor/github.com/containers/storage/pkg/chunked/storage_unsupported.go +++ b/vendor/github.com/containers/storage/pkg/chunked/storage_unsupported.go @@ -9,16 +9,9 @@ import ( storage "github.com/containers/storage" graphdriver "github.com/containers/storage/drivers" - digest "github.com/opencontainers/go-digest" ) // GetDiffer returns a differ than can be used with ApplyDiffWithDiffer. func GetDiffer(ctx context.Context, store storage.Store, blobSize int64, annotations map[string]string, iss ImageSourceSeekable) (graphdriver.Differ, error) { return nil, errors.New("format not supported on this system") } - -// GetTOCDigest returns the digest of the TOC as recorded in the annotations. -// This is an experimental feature and may be changed/removed in the future. -func GetTOCDigest(annotations map[string]string) (*digest.Digest, error) { - return nil, errors.New("format not supported on this system") -} diff --git a/vendor/github.com/containers/storage/store.go b/vendor/github.com/containers/storage/store.go index 14c1edd7f8..a31aebfd24 100644 --- a/vendor/github.com/containers/storage/store.go +++ b/vendor/github.com/containers/storage/store.go @@ -1459,6 +1459,7 @@ func (s *store) PutLayer(id, parent string, names []string, mountLabel string, w layerOptions := LayerOptions{ OriginalDigest: options.OriginalDigest, UncompressedDigest: options.UncompressedDigest, + Flags: options.Flags, } if s.canUseShifting(uidMap, gidMap) { layerOptions.IDMappingOptions = types.IDMappingOptions{HostUIDMapping: true, HostGIDMapping: true, UIDMap: nil, GIDMap: nil} diff --git a/vendor/github.com/opencontainers/runc/libcontainer/user/user.go b/vendor/github.com/opencontainers/runc/libcontainer/user/user.go index a1e216683d..984466d1ab 100644 --- a/vendor/github.com/opencontainers/runc/libcontainer/user/user.go +++ b/vendor/github.com/opencontainers/runc/libcontainer/user/user.go @@ -201,7 +201,7 @@ func ParseGroupFilter(r io.Reader, filter func(Group) bool) ([]Group, error) { if err != nil { // We should return no error if EOF is reached // without a match. - if err == io.EOF { //nolint:errorlint // comparison with io.EOF is legit, https://github.com/polyfloyd/go-errorlint/pull/12 + if err == io.EOF { err = nil } return out, err diff --git a/vendor/modules.txt b/vendor/modules.txt index 2eed921634..7edeb16a7a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -161,7 +161,7 @@ github.com/containers/ocicrypt/keywrap/pkcs7 github.com/containers/ocicrypt/spec github.com/containers/ocicrypt/utils github.com/containers/ocicrypt/utils/keyprovider -# github.com/containers/storage v1.48.1-0.20230728131509-c3da76fa3f63 +# github.com/containers/storage v1.49.0 ## explicit; go 1.19 github.com/containers/storage github.com/containers/storage/drivers @@ -432,7 +432,7 @@ github.com/opencontainers/image-spec/specs-go/v1 # github.com/opencontainers/image-tools v1.0.0-rc3 ## explicit github.com/opencontainers/image-tools/image -# github.com/opencontainers/runc v1.1.8 +# github.com/opencontainers/runc v1.1.9 ## explicit; go 1.17 github.com/opencontainers/runc/libcontainer/user # github.com/opencontainers/runtime-spec v1.1.0