mirror of
https://github.com/containers/skopeo.git
synced 2025-08-11 11:22:05 +00:00
vendor containers/image for oci dest fix
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
f37d72d964
commit
9914de1bf4
11
vendor/github.com/containers/image/oci/oci_dest.go
generated
vendored
11
vendor/github.com/containers/image/oci/oci_dest.go
generated
vendored
@ -96,7 +96,11 @@ func (d *ociImageDestination) PutManifest(m []byte) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := ioutil.WriteFile(d.ref.blobPath(digest), ociMan, 0644); err != nil {
|
blobPath, err := d.ref.blobPath(digest)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := ioutil.WriteFile(blobPath, ociMan, 0644); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// TODO(runcom): ugly here?
|
// TODO(runcom): ugly here?
|
||||||
@ -116,7 +120,10 @@ func (d *ociImageDestination) PutManifest(m []byte) error {
|
|||||||
// If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlob MUST 1) fail, and 2) delete any data stored so far.
|
// If stream.Read() at any time, ESPECIALLY at end of input, returns an error, PutBlob MUST 1) fail, and 2) delete any data stored so far.
|
||||||
// Note: Calling PutBlob() and other methods may have ordering dependencies WRT other methods of this type. FIXME: Figure out and document.
|
// Note: Calling PutBlob() and other methods may have ordering dependencies WRT other methods of this type. FIXME: Figure out and document.
|
||||||
func (d *ociImageDestination) PutBlob(digest string, stream io.Reader) error {
|
func (d *ociImageDestination) PutBlob(digest string, stream io.Reader) error {
|
||||||
blobPath := d.ref.blobPath(digest)
|
blobPath, err := d.ref.blobPath(digest)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if err := ensureParentDirectoryExists(blobPath); err != nil {
|
if err := ensureParentDirectoryExists(blobPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
8
vendor/github.com/containers/image/oci/oci_transport.go
generated
vendored
8
vendor/github.com/containers/image/oci/oci_transport.go
generated
vendored
@ -192,8 +192,12 @@ func (ref ociReference) ociLayoutPath() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// blobPath returns a path for a blob within a directory using OCI image-layout conventions.
|
// blobPath returns a path for a blob within a directory using OCI image-layout conventions.
|
||||||
func (ref ociReference) blobPath(digest string) string {
|
func (ref ociReference) blobPath(digest string) (string, error) {
|
||||||
return filepath.Join(ref.dir, "blobs", strings.Replace(digest, ":", "-", -1))
|
pts := strings.SplitN(digest, ":", 2)
|
||||||
|
if len(pts) != 2 {
|
||||||
|
return "", fmt.Errorf("unexpected digest reference %s", digest)
|
||||||
|
}
|
||||||
|
return filepath.Join(ref.dir, "blobs", pts[0], pts[1]), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// descriptorPath returns a path for the manifest within a directory using OCI conventions.
|
// descriptorPath returns a path for the manifest within a directory using OCI conventions.
|
||||||
|
Loading…
Reference in New Issue
Block a user