vendor: bump containers/image and containers/image

Update containers/image and containers/storage to the current master
revisions.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2018-01-16 19:47:33 +01:00
parent d8e506c648
commit 64b3bd28e3
No known key found for this signature in database
GPG Key ID: 263D6DF2E163E1EA
6 changed files with 23 additions and 11 deletions

View File

@ -70,7 +70,7 @@ func newImageDestination(ref dirReference, compress bool) (types.ImageDestinatio
} }
} }
// create version file // create version file
err = ioutil.WriteFile(d.ref.versionPath(), []byte(version), 0755) err = ioutil.WriteFile(d.ref.versionPath(), []byte(version), 0644)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "error creating version file %q", d.ref.versionPath()) return nil, errors.Wrapf(err, "error creating version file %q", d.ref.versionPath())
} }

View File

@ -131,7 +131,7 @@ func (d *dockerImageDestination) PutBlob(stream io.Reader, inputInfo types.BlobI
defer res.Body.Close() defer res.Body.Close()
if res.StatusCode != http.StatusAccepted { if res.StatusCode != http.StatusAccepted {
logrus.Debugf("Error initiating layer upload, response %#v", *res) 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() uploadLocation, err := res.Location()
if err != nil { if err != nil {
@ -167,7 +167,7 @@ func (d *dockerImageDestination) PutBlob(stream io.Reader, inputInfo types.BlobI
defer res.Body.Close() defer res.Body.Close()
if res.StatusCode != http.StatusCreated { if res.StatusCode != http.StatusCreated {
logrus.Debugf("Error uploading layer, response %#v", *res) 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) logrus.Debugf("Upload of layer %s complete", computedDigest)
@ -447,7 +447,7 @@ sigExists:
logrus.Debugf("Error body %s", string(body)) logrus.Debugf("Error body %s", string(body))
} }
logrus.Debugf("Error uploading signature, status %d, %#v", res.StatusCode, res) 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)
} }
} }

View File

@ -149,6 +149,16 @@ func (m *manifestOCI1) UpdatedImage(options types.ManifestUpdateOptions) (types.
switch options.ManifestMIMEType { switch options.ManifestMIMEType {
case "": // No conversion, OK 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: case manifest.DockerV2Schema2MediaType:
return copy.convertToManifestSchema2() return copy.convertToManifestSchema2()
default: default:

View File

@ -14,6 +14,7 @@ import (
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings"
"syscall" "syscall"
"time" "time"
"unsafe" "unsafe"
@ -175,7 +176,10 @@ func fixFiles(selinuxHnd *C.struct_selabel_handle, root string, dir string, user
if err != nil { if err != nil {
return err 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) relPathC := C.CString(relPath)
defer C.free(unsafe.Pointer(relPathC)) defer C.free(unsafe.Pointer(relPathC))
@ -237,7 +241,7 @@ func generateTarSplitMetadata(output *bytes.Buffer, file string) error {
} }
defer stream.Close() defer stream.Close()
gzReader, err := gzip.NewReader(stream) gzReader, err := archive.DecompressStream(stream)
if err != nil { if err != nil {
return err return err
} }
@ -383,7 +387,7 @@ func (d *ostreeImageDestination) Commit() error {
var selinuxHnd *C.struct_selabel_handle var selinuxHnd *C.struct_selabel_handle
if os.Getuid() == 0 && selinux.GetEnabled() { 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 { if selinuxHnd == nil {
return errors.Wrapf(err, "cannot open the SELinux DB") return errors.Wrapf(err, "cannot open the SELinux DB")
} }

View File

@ -89,5 +89,5 @@ func (r *tarballReference) DeleteImage(ctx *types.SystemContext) error {
} }
func (r *tarballReference) NewImageDestination(ctx *types.SystemContext) (types.ImageDestination, 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`)
} }

View File

@ -245,9 +245,7 @@ func supportsOverlay(home string, homeMagic graphdriver.FsMagic, rootUID, rootGI
return false, err return false, err
} }
if !supportsDType { if !supportsDType {
logrus.Warn(overlayutils.ErrDTypeNotSupported("overlay", backingFs)) return false, overlayutils.ErrDTypeNotSupported("overlay", backingFs)
// TODO: Will make fatal when CRI-O Has AMI built on RHEL7.4
// return nil, overlayutils.ErrDTypeNotSupported("overlay", backingFs)
} }
// Try a test mount in the specific location we're looking at using. // Try a test mount in the specific location we're looking at using.