Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public interface BuildableManifestTemplate extends ManifestTemplate {
*/
class ContentDescriptorTemplate implements JsonTemplate {

@SuppressWarnings("unused")
@Nullable
private String mediaType;

Expand All @@ -61,6 +60,11 @@ class ContentDescriptorTemplate implements JsonTemplate {
@SuppressWarnings("unused")
protected ContentDescriptorTemplate() {}

@Nullable
public String getMediaType() {
return mediaType;
}

public long getSize() {
return size;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@ public void testFromJson() throws IOException, URISyntaxException, DigestExcepti

Assert.assertEquals(1000, manifestJson.getContainerConfiguration().getSize());

BuildableManifestTemplate.ContentDescriptorTemplate layer = manifestJson.getLayers().get(0);

Assert.assertEquals(
DescriptorDigest.fromHash(
"4945ba5011739b0b98c4a41afe224e417f47c7c99b2ce76830999c9a0861b236"),
manifestJson.getLayers().get(0).getDigest());
layer.getDigest());

Assert.assertEquals(1000_000, layer.getSize());

Assert.assertEquals(1000_000, manifestJson.getLayers().get(0).getSize());
Assert.assertEquals("application/vnd.oci.image.manifest.v1+json", layer.getMediaType());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,16 @@ public void testFromJson() throws IOException, URISyntaxException, DigestExcepti

Assert.assertEquals(1000, manifestJson.getContainerConfiguration().getSize());

ContentDescriptorTemplate layer = manifestJson.getLayers().get(0);

Assert.assertEquals(
DescriptorDigest.fromHash(
"4945ba5011739b0b98c4a41afe224e417f47c7c99b2ce76830999c9a0861b236"),
manifestJson.getLayers().get(0).getDigest());
layer.getDigest());

Assert.assertEquals(1000_000, layer.getSize());

Assert.assertEquals(1000_000, manifestJson.getLayers().get(0).getSize());
Assert.assertEquals("application/vnd.docker.image.rootfs.diff.tar.gzip", layer.getMediaType());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
"size": 4,
"urls": ["cool-url"],
"annotations": {"key1":"value1", "key2":"value2"}
},
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"size": 5
}
]
}