diff --git a/jib-core/src/main/java/com/google/cloud/tools/jib/docker/json/DockerManifestEntryTemplate.java b/jib-core/src/main/java/com/google/cloud/tools/jib/docker/json/DockerManifestEntryTemplate.java index 2d5fd641c0..d0debc8dff 100644 --- a/jib-core/src/main/java/com/google/cloud/tools/jib/docker/json/DockerManifestEntryTemplate.java +++ b/jib-core/src/main/java/com/google/cloud/tools/jib/docker/json/DockerManifestEntryTemplate.java @@ -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; @@ -46,6 +47,7 @@ * @see Docker load * source */ +@JsonIgnoreProperties(ignoreUnknown = true) public class DockerManifestEntryTemplate implements JsonTemplate { @JsonProperty("Config") diff --git a/jib-core/src/test/java/com/google/cloud/tools/jib/docker/json/DockerManifestEntryTemplateTest.java b/jib-core/src/test/java/com/google/cloud/tools/jib/docker/json/DockerManifestEntryTemplateTest.java index 25051ac2f1..142522118e 100644 --- a/jib-core/src/test/java/com/google/cloud/tools/jib/docker/json/DockerManifestEntryTemplateTest.java +++ b/jib-core/src/test/java/com/google/cloud/tools/jib/docker/json/DockerManifestEntryTemplateTest.java @@ -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]; diff --git a/jib-core/src/test/resources/core/json/loadmanifest2.json b/jib-core/src/test/resources/core/json/loadmanifest2.json new file mode 100644 index 0000000000..1bbe7173f1 --- /dev/null +++ b/jib-core/src/test/resources/core/json/loadmanifest2.json @@ -0,0 +1 @@ +[{"Config":"config.json","RepoTags":["testregistry/testrepo:testtag"],"Layers":["layer1.tar.gz","layer2.tar.gz","layer3.tar.gz"],"LayerSources":{}}]