Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion image/fixtures/oci1-to-schema2.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"size": 11739507,
"digest": "sha256:8f5dc8a4b12c307ac84de90cdd9a7f3915d1be04c9388868ca118831099c67a9"
"digest": "sha256:8f5dc8a4b12c307ac84de90cdd9a7f3915d1be04c9388868ca118831099c67a9",
"urls": ["https://layer.url"]
},
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
Expand Down
3 changes: 2 additions & 1 deletion image/fixtures/oci1.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"size": 11739507,
"digest": "sha256:8f5dc8a4b12c307ac84de90cdd9a7f3915d1be04c9388868ca118831099c67a9"
"digest": "sha256:8f5dc8a4b12c307ac84de90cdd9a7f3915d1be04c9388868ca118831099c67a9",
"urls": ["https://layer.url"]
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
Expand Down
3 changes: 2 additions & 1 deletion image/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (m *manifestOCI1) OCIConfig() (*imgspecv1.Image, error) {
func (m *manifestOCI1) LayerInfos() []types.BlobInfo {
blobs := []types.BlobInfo{}
for _, layer := range m.LayersDescriptors {
blobs = append(blobs, types.BlobInfo{Digest: layer.Digest, Size: layer.Size, Annotations: layer.Annotations})
blobs = append(blobs, types.BlobInfo{Digest: layer.Digest, Size: layer.Size, Annotations: layer.Annotations, URLs: layer.URLs})
}
return blobs
}
Expand Down Expand Up @@ -160,6 +160,7 @@ func (m *manifestOCI1) UpdatedImage(options types.ManifestUpdateOptions) (types.
copy.LayersDescriptors[i].Digest = info.Digest
copy.LayersDescriptors[i].Size = info.Size
copy.LayersDescriptors[i].Annotations = info.Annotations
copy.LayersDescriptors[i].URLs = info.URLs
}
}
// Ignore options.EmbeddedDockerReference: it may be set when converting from schema1, but we really don't care.
Expand Down
6 changes: 6 additions & 0 deletions image/oci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func manifestOCI1FromComponentsLikeFixture(configBlob []byte) genericManifest {
MediaType: imgspecv1.MediaTypeImageLayerGzip,
Digest: "sha256:8f5dc8a4b12c307ac84de90cdd9a7f3915d1be04c9388868ca118831099c67a9",
Size: 11739507,
URLs: []string{
"https://layer.url",
},
}},
{
descriptor: descriptor{
Expand Down Expand Up @@ -207,6 +210,9 @@ func TestManifestOCI1LayerInfo(t *testing.T) {
{
Digest: "sha256:8f5dc8a4b12c307ac84de90cdd9a7f3915d1be04c9388868ca118831099c67a9",
Size: 11739507,
URLs: []string{
"https://layer.url",
},
},
{
Digest: "sha256:bbd6b22eb11afce63cc76f6bc41042d99f10d6024c96b655dafba930b8d25909",
Expand Down
5 changes: 1 addition & 4 deletions oci/archive/oci_dest.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,8 @@ func (d *ociArchiveImageDestination) Commit() error {
src := d.tempDirRef.tempDirectory
// path to save tarred up file
dst := d.ref.resolvedFile
if err := tarDirectory(src, dst); err != nil {
return err
}

return nil
return tarDirectory(src, dst)
}

// tar converts the directory at src and saves it to dst
Expand Down
8 changes: 2 additions & 6 deletions signature/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,9 @@ func (s *untrustedSignature) strictUnmarshalJSON(data []byte) error {
}
s.UntrustedDockerManifestDigest = digest.Digest(digestString)

if err := paranoidUnmarshalJSONObjectExactFields(identity, map[string]interface{}{
return paranoidUnmarshalJSONObjectExactFields(identity, map[string]interface{}{
"docker-reference": &s.UntrustedDockerReference,
}); err != nil {
return err
}

return nil
})
}

// Sign formats the signature and returns a blob signed using mech and keyIdentity
Expand Down