diff --git a/jib-core/CHANGELOG.md b/jib-core/CHANGELOG.md index d9571f559a..06e4e37f27 100644 --- a/jib-core/CHANGELOG.md +++ b/jib-core/CHANGELOG.md @@ -2,9 +2,15 @@ All notable changes to this project will be documented in this file. ## [unreleased] + ### Added +- + ### Changed +- + ### Fixed +- fix: support parsing manifest JSON containing `LayerSources:` from latest Docker. ([#4171](https://github.com/GoogleContainerTools/jib/pull/4171)) ## 0.25.0 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..5048f33c4e 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; @@ -27,7 +28,7 @@ * a tag is missing, it explicitly should use "latest". * *
Note that this is a template for a single Manifest entry, while the entire Docker Manifest
- * should be {@code List Example manifest entry JSON:
*
@@ -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":{}}]
diff --git a/jib-gradle-plugin/CHANGELOG.md b/jib-gradle-plugin/CHANGELOG.md
index dd7708b1fc..b2aef812d0 100644
--- a/jib-gradle-plugin/CHANGELOG.md
+++ b/jib-gradle-plugin/CHANGELOG.md
@@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file.
-
### Fixed
--
+- fix: support parsing manifest JSON containing `LayerSources:` from latest Docker. ([#4171](https://github.com/GoogleContainerTools/jib/pull/4171))
## 3.4.0
@@ -93,7 +93,6 @@ Thanks to our community contributors @wwadge, @oliver-brm, @rquinio and @gsquare
- Fixed setting image format in Kotlin ([#3593](https://github.com/GoogleContainerTools/jib/pull/3593)).
-
## 3.2.0
### Added
diff --git a/jib-maven-plugin/CHANGELOG.md b/jib-maven-plugin/CHANGELOG.md
index 7d2d9fc889..53957ba9e8 100644
--- a/jib-maven-plugin/CHANGELOG.md
+++ b/jib-maven-plugin/CHANGELOG.md
@@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file.
-
### Fixed
--
+- fix: support parsing manifest JSON containing `LayerSources:` from latest Docker. ([#4171](https://github.com/GoogleContainerTools/jib/pull/4171))
## 3.4.0
@@ -75,7 +75,6 @@ Thanks to our community contributors @wwadge, @oliver-brm, @rquinio and @gsquare
- Upgraded jackson-databind to 2.13.2.2 ([#3612](https://github.com/GoogleContainerTools/jib/pull/3612)).
-
## 3.2.0
### Added