From e0dcffa8d1c0b6c97222f2a49f6b6b83e0e3173a Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 10 Jun 2021 13:06:04 +0200 Subject: [PATCH] [v3.2] vendor containers/common@v0.38.9 The fixes will allow for creating containers with a corrupted image in which case the image will be repulled. BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1966872 Signed-off-by: Valentin Rothberg --- go.mod | 2 +- go.sum | 4 ++-- .../github.com/containers/common/libimage/runtime.go | 12 ++++++++++-- .../github.com/containers/common/version/version.go | 2 +- vendor/modules.txt | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index fdfd06e29a..f701a495f3 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/containernetworking/cni v0.8.1 github.com/containernetworking/plugins v0.9.1 github.com/containers/buildah v1.21.0 - github.com/containers/common v0.38.7 + github.com/containers/common v0.38.9 github.com/containers/conmon v2.0.20+incompatible github.com/containers/image/v5 v5.12.0 github.com/containers/ocicrypt v1.1.1 diff --git a/go.sum b/go.sum index a2896068f0..28143c399d 100644 --- a/go.sum +++ b/go.sum @@ -218,8 +218,8 @@ github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRD github.com/containers/buildah v1.21.0 h1:LuwuqRPjan3X3AIdGwfkEkqMgmrDMNpQznFqNdHgCz8= github.com/containers/buildah v1.21.0/go.mod h1:yPdlpVd93T+i91yGxrJbW1YOWrqN64j5ZhHOZmHUejs= github.com/containers/common v0.38.4/go.mod h1:egfpX/Y3+19Dz4Wa1eRZDdgzoEOeneieF9CQppKzLBg= -github.com/containers/common v0.38.7 h1:w1znnTaOEIfUfHKTLva9NUAo0AVysXSvA/QNk0+S1W4= -github.com/containers/common v0.38.7/go.mod h1:egfpX/Y3+19Dz4Wa1eRZDdgzoEOeneieF9CQppKzLBg= +github.com/containers/common v0.38.9 h1:73TUUqIIMRU6hNqrgmZy4vlWPgMz4A/oFfi+v2VEdkg= +github.com/containers/common v0.38.9/go.mod h1:egfpX/Y3+19Dz4Wa1eRZDdgzoEOeneieF9CQppKzLBg= github.com/containers/conmon v2.0.20+incompatible h1:YbCVSFSCqFjjVwHTPINGdMX1F6JXHGTUje2ZYobNrkg= github.com/containers/conmon v2.0.20+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I= github.com/containers/image/v5 v5.12.0 h1:1hNS2QkzFQ4lH3GYQLyAXB0acRMhS1Ubm6oV++8vw4w= diff --git a/vendor/github.com/containers/common/libimage/runtime.go b/vendor/github.com/containers/common/libimage/runtime.go index 422cd60690..382a28c8bd 100644 --- a/vendor/github.com/containers/common/libimage/runtime.go +++ b/vendor/github.com/containers/common/libimage/runtime.go @@ -132,13 +132,21 @@ func (r *Runtime) storageToImage(storageImage *storage.Image, ref types.ImageRef } // Exists returns true if the specicifed image exists in the local containers -// storage. +// storage. Note that it may return false if an image corrupted. func (r *Runtime) Exists(name string) (bool, error) { image, _, err := r.LookupImage(name, &LookupImageOptions{IgnorePlatform: true}) if err != nil && errors.Cause(err) != storage.ErrImageUnknown { return false, err } - return image != nil, nil + if image == nil { + return false, nil + } + // Inspect the image to make sure if it's corrupted or not. + if _, err := image.Inspect(context.Background(), false); err != nil { + logrus.Errorf("Image %s exists in local storage but may be corrupted: %v", name, err) + return false, nil + } + return true, nil } // LookupImageOptions allow for customizing local image lookups. diff --git a/vendor/github.com/containers/common/version/version.go b/vendor/github.com/containers/common/version/version.go index 086f3ce259..6af1594bac 100644 --- a/vendor/github.com/containers/common/version/version.go +++ b/vendor/github.com/containers/common/version/version.go @@ -1,4 +1,4 @@ package version // Version is the version of the build. -const Version = "0.38.7" +const Version = "0.38.9" diff --git a/vendor/modules.txt b/vendor/modules.txt index 63d8fcc568..03099235ee 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -91,7 +91,7 @@ github.com/containers/buildah/pkg/overlay github.com/containers/buildah/pkg/parse github.com/containers/buildah/pkg/rusage github.com/containers/buildah/util -# github.com/containers/common v0.38.7 +# github.com/containers/common v0.38.9 github.com/containers/common/libimage github.com/containers/common/libimage/manifests github.com/containers/common/pkg/apparmor