From 890c0735266fe3e3186a68da30ce6c39e1de6d6a Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Mon, 12 Sep 2016 17:25:52 +0200 Subject: [PATCH] vendor containers/image#84 Signed-off-by: Antonio Murdaca --- .../containers/image/oci/layout/oci_dest.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vendor/github.com/containers/image/oci/layout/oci_dest.go b/vendor/github.com/containers/image/oci/layout/oci_dest.go index 1408cd529d..5ea52fd394 100644 --- a/vendor/github.com/containers/image/oci/layout/oci_dest.go +++ b/vendor/github.com/containers/image/oci/layout/oci_dest.go @@ -4,6 +4,7 @@ import ( "crypto/sha256" "encoding/hex" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -106,12 +107,12 @@ func createManifest(m []byte) ([]byte, string, error) { om := imgspecv1.Manifest{} mt := manifest.GuessMIMEType(m) switch mt { - case manifest.DockerV2Schema1MediaType: + case manifest.DockerV2Schema1MediaType, manifest.DockerV2Schema1SignedMediaType: // There a simple reason about not yet implementing this. // OCI image-spec assure about backward compatibility with docker v2s2 but not v2s1 // generating a v2s2 is a migration docker does when upgrading to 1.10.3 // and I don't think we should bother about this now (I don't want to have migration code here in skopeo) - return nil, "", fmt.Errorf("can't create OCI manifest from Docker V2 schema 1 manifest") + return nil, "", errors.New("can't create an OCI manifest from Docker V2 schema 1 manifest") case manifest.DockerV2Schema2MediaType: if err := json.Unmarshal(m, &om); err != nil { return nil, "", err @@ -127,13 +128,13 @@ func createManifest(m []byte) ([]byte, string, error) { } return b, om.MediaType, nil case manifest.DockerV2ListMediaType: - return nil, "", fmt.Errorf("can't create OCI manifest from Docker V2 schema 2 manifest list") + return nil, "", errors.New("can't create an OCI manifest from Docker V2 schema 2 manifest list") case imgspecv1.MediaTypeImageManifestList: - return nil, "", fmt.Errorf("can't create OCI manifest from OCI manifest list") + return nil, "", errors.New("can't create an OCI manifest from OCI manifest list") case imgspecv1.MediaTypeImageManifest: return m, mt, nil } - return nil, "", fmt.Errorf("Unrecognized manifest media type") + return nil, "", fmt.Errorf("unrecognized manifest media type %q", mt) } func (d *ociImageDestination) PutManifest(m []byte) error {