From e0dcffa8d1c0b6c97222f2a49f6b6b83e0e3173a Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 10 Jun 2021 13:06:04 +0200 Subject: [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 --- vendor/github.com/containers/common/libimage/runtime.go | 12 ++++++++++-- vendor/github.com/containers/common/version/version.go | 2 +- vendor/modules.txt | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'vendor') diff --git a/vendor/github.com/containers/common/libimage/runtime.go b/vendor/github.com/containers/common/libimage/runtime.go index 422cd6069..382a28c8b 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 086f3ce25..6af1594ba 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 63d8fcc56..03099235e 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 -- cgit v1.2.3-54-g00ecf