Skip to content

Commit

Permalink
fix: support manifest JSON from latest Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
chanseokoh committed Jan 22, 2024
1 parent 440bd48 commit 943975e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.google.cloud.tools.jib.docker.json;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.cloud.tools.jib.json.JsonTemplate;
import com.google.common.annotations.VisibleForTesting;
Expand Down Expand Up @@ -46,6 +47,7 @@
* @see <a href="https://github.com/moby/moby/blob/master/image/tarexport/load.go">Docker load
* source</a>
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class DockerManifestEntryTemplate implements JsonTemplate {

@JsonProperty("Config")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void testToJson() throws URISyntaxException, IOException {
@Test
public void testFromJson() throws URISyntaxException, IOException {
// Loads the expected JSON string.
Path jsonFile = Paths.get(Resources.getResource("core/json/loadmanifest.json").toURI());
Path jsonFile = Paths.get(Resources.getResource("core/json/loadmanifest2.json").toURI());
String sourceJson = new String(Files.readAllBytes(jsonFile), StandardCharsets.UTF_8);
DockerManifestEntryTemplate template =
new ObjectMapper().readValue(sourceJson, DockerManifestEntryTemplate[].class)[0];
Expand Down
1 change: 1 addition & 0 deletions jib-core/src/test/resources/core/json/loadmanifest2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"Config":"config.json","RepoTags":["testregistry/testrepo:testtag"],"Layers":["layer1.tar.gz","layer2.tar.gz","layer3.tar.gz"],"LayerSources":{}}]

0 comments on commit 943975e

Please sign in to comment.