From 64b3bd28e37897e1855288befc8d082ecb9dedcc Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Tue, 16 Jan 2018 19:47:33 +0100 Subject: [PATCH] vendor: bump containers/image and containers/image Update containers/image and containers/storage to the current master revisions. Signed-off-by: Giuseppe Scrivano --- .../containers/image/directory/directory_dest.go | 2 +- .../containers/image/docker/docker_image_dest.go | 6 +++--- vendor/github.com/containers/image/image/oci.go | 10 ++++++++++ .../github.com/containers/image/ostree/ostree_dest.go | 10 +++++++--- .../containers/image/tarball/tarball_reference.go | 2 +- .../containers/storage/drivers/overlay/overlay.go | 4 +--- 6 files changed, 23 insertions(+), 11 deletions(-) diff --git a/vendor/github.com/containers/image/directory/directory_dest.go b/vendor/github.com/containers/image/directory/directory_dest.go index 47d59d9fee..5f7443fa0f 100644 --- a/vendor/github.com/containers/image/directory/directory_dest.go +++ b/vendor/github.com/containers/image/directory/directory_dest.go @@ -70,7 +70,7 @@ func newImageDestination(ref dirReference, compress bool) (types.ImageDestinatio } } // create version file - err = ioutil.WriteFile(d.ref.versionPath(), []byte(version), 0755) + err = ioutil.WriteFile(d.ref.versionPath(), []byte(version), 0644) if err != nil { return nil, errors.Wrapf(err, "error creating version file %q", d.ref.versionPath()) } diff --git a/vendor/github.com/containers/image/docker/docker_image_dest.go b/vendor/github.com/containers/image/docker/docker_image_dest.go index 79c386225d..9a6c351378 100644 --- a/vendor/github.com/containers/image/docker/docker_image_dest.go +++ b/vendor/github.com/containers/image/docker/docker_image_dest.go @@ -131,7 +131,7 @@ func (d *dockerImageDestination) PutBlob(stream io.Reader, inputInfo types.BlobI defer res.Body.Close() if res.StatusCode != http.StatusAccepted { logrus.Debugf("Error initiating layer upload, response %#v", *res) - return types.BlobInfo{}, errors.Errorf("Error initiating layer upload to %s, status %d", uploadPath, res.StatusCode) + return types.BlobInfo{}, errors.Wrapf(client.HandleErrorResponse(res), "Error initiating layer upload to %s", uploadPath) } uploadLocation, err := res.Location() if err != nil { @@ -167,7 +167,7 @@ func (d *dockerImageDestination) PutBlob(stream io.Reader, inputInfo types.BlobI defer res.Body.Close() if res.StatusCode != http.StatusCreated { logrus.Debugf("Error uploading layer, response %#v", *res) - return types.BlobInfo{}, errors.Errorf("Error uploading layer to %s, status %d", uploadLocation, res.StatusCode) + return types.BlobInfo{}, errors.Wrapf(client.HandleErrorResponse(res), "Error uploading layer to %s", uploadLocation) } logrus.Debugf("Upload of layer %s complete", computedDigest) @@ -447,7 +447,7 @@ sigExists: logrus.Debugf("Error body %s", string(body)) } logrus.Debugf("Error uploading signature, status %d, %#v", res.StatusCode, res) - return errors.Errorf("Error uploading signature to %s, status %d", path, res.StatusCode) + return errors.Wrapf(client.HandleErrorResponse(res), "Error uploading signature to %s", path) } } diff --git a/vendor/github.com/containers/image/image/oci.go b/vendor/github.com/containers/image/image/oci.go index 3c03e49bbf..e7780c5a6f 100644 --- a/vendor/github.com/containers/image/image/oci.go +++ b/vendor/github.com/containers/image/image/oci.go @@ -149,6 +149,16 @@ func (m *manifestOCI1) UpdatedImage(options types.ManifestUpdateOptions) (types. switch options.ManifestMIMEType { case "": // No conversion, OK + case manifest.DockerV2Schema1MediaType, manifest.DockerV2Schema1SignedMediaType: + // We can't directly convert to V1, but we can transitively convert via a V2 image + m2, err := copy.convertToManifestSchema2() + if err != nil { + return nil, err + } + return m2.UpdatedImage(types.ManifestUpdateOptions{ + ManifestMIMEType: options.ManifestMIMEType, + InformationOnly: options.InformationOnly, + }) case manifest.DockerV2Schema2MediaType: return copy.convertToManifestSchema2() default: diff --git a/vendor/github.com/containers/image/ostree/ostree_dest.go b/vendor/github.com/containers/image/ostree/ostree_dest.go index 8154c98515..d5f0ff80cc 100644 --- a/vendor/github.com/containers/image/ostree/ostree_dest.go +++ b/vendor/github.com/containers/image/ostree/ostree_dest.go @@ -14,6 +14,7 @@ import ( "os/exec" "path/filepath" "strconv" + "strings" "syscall" "time" "unsafe" @@ -175,7 +176,10 @@ func fixFiles(selinuxHnd *C.struct_selabel_handle, root string, dir string, user if err != nil { return err } - relPath = fmt.Sprintf("/%s", relPath) + // Handle /exports/hostfs as a special case. Files under this directory are copied to the host, + // thus we benefit from maintaining the same SELinux label they would have on the host as we could + // use hard links instead of copying the files. + relPath = fmt.Sprintf("/%s", strings.TrimPrefix(relPath, "exports/hostfs/")) relPathC := C.CString(relPath) defer C.free(unsafe.Pointer(relPathC)) @@ -237,7 +241,7 @@ func generateTarSplitMetadata(output *bytes.Buffer, file string) error { } defer stream.Close() - gzReader, err := gzip.NewReader(stream) + gzReader, err := archive.DecompressStream(stream) if err != nil { return err } @@ -383,7 +387,7 @@ func (d *ostreeImageDestination) Commit() error { var selinuxHnd *C.struct_selabel_handle if os.Getuid() == 0 && selinux.GetEnabled() { - selinuxHnd, err := C.selabel_open(C.SELABEL_CTX_FILE, nil, 0) + selinuxHnd, err = C.selabel_open(C.SELABEL_CTX_FILE, nil, 0) if selinuxHnd == nil { return errors.Wrapf(err, "cannot open the SELinux DB") } diff --git a/vendor/github.com/containers/image/tarball/tarball_reference.go b/vendor/github.com/containers/image/tarball/tarball_reference.go index 4ccfb40630..a0819ac580 100644 --- a/vendor/github.com/containers/image/tarball/tarball_reference.go +++ b/vendor/github.com/containers/image/tarball/tarball_reference.go @@ -89,5 +89,5 @@ func (r *tarballReference) DeleteImage(ctx *types.SystemContext) error { } func (r *tarballReference) NewImageDestination(ctx *types.SystemContext) (types.ImageDestination, error) { - return nil, fmt.Errorf("destination not implemented yet") + return nil, fmt.Errorf(`"tarball:" locations can only be read from, not written to`) } diff --git a/vendor/github.com/containers/storage/drivers/overlay/overlay.go b/vendor/github.com/containers/storage/drivers/overlay/overlay.go index 4974a94e93..81ca6694c0 100644 --- a/vendor/github.com/containers/storage/drivers/overlay/overlay.go +++ b/vendor/github.com/containers/storage/drivers/overlay/overlay.go @@ -245,9 +245,7 @@ func supportsOverlay(home string, homeMagic graphdriver.FsMagic, rootUID, rootGI return false, err } if !supportsDType { - logrus.Warn(overlayutils.ErrDTypeNotSupported("overlay", backingFs)) - // TODO: Will make fatal when CRI-O Has AMI built on RHEL7.4 - // return nil, overlayutils.ErrDTypeNotSupported("overlay", backingFs) + return false, overlayutils.ErrDTypeNotSupported("overlay", backingFs) } // Try a test mount in the specific location we're looking at using.