Skip to content

Issue #4506: ignore unknown "artifactType" field in manifest descriptors#4509

Open
austek wants to merge 1 commit into
GoogleContainerTools:masterfrom
austek:issue-4506-artifacttype
Open

Issue #4506: ignore unknown "artifactType" field in manifest descriptors#4509
austek wants to merge 1 commit into
GoogleContainerTools:masterfrom
austek:issue-4506-artifacttype

Conversation

@austek

@austek austek commented Jun 10, 2026

Copy link
Copy Markdown

Fixes #4506

Problem

Newer Docker (29.5.1) emits the OCI 1.1 optional artifactType field on manifest descriptors in an image index. Jib does not model this field and the manifest descriptor templates were not marked to ignore unknown properties, so deserializing such a base (FROM) image's index/manifest-list fails:

Unrecognized field "artifactType" (class com.google.cloud.tools.jib.image.json.OciIndexTemplate$ManifestDescriptorTemplate), not marked as ignorable ...

Fix

Add @JsonIgnoreProperties(ignoreUnknown = true) to the manifest descriptor templates in OciIndexTemplate and V22ManifestListTemplate, matching the precedent already used elsewhere in the JSON templates (Platform, HistoryEntry, ContainerConfigurationTemplate, etc.).

The descriptors in a base image's index are informational pointers Jib uses only to select the correct platform manifest, so ignoring unrecognized properties is the appropriate, forward-compatible behavior (it also covers other spec-defined descriptor fields such as data).

Tests

  • New ociindex_artifacttype.json resource (mirroring the manifest in the issue) and OciIndexTemplateTest#testFromJsonWithUnknownProperties, asserting parsing succeeds and platform digests resolve.
  • Added artifactType to an entry in the existing v22manifest_list.json so V22ManifestListTemplateTest regression-covers the manifest-list case.

@google-cla

google-cla Bot commented Jun 10, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds the @JsonIgnoreProperties(ignoreUnknown = true) annotation to the ManifestDescriptorTemplate classes in both OciIndexTemplate and V22ManifestListTemplate. This ensures that unknown properties, such as the OCI 1.1 artifactType field, are ignored during JSON parsing instead of causing failures. Additionally, a new test case and test JSON files have been added to verify this behavior. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@austek

austek commented Jun 10, 2026

Copy link
Copy Markdown
Author

@googlebot I signed it!

@austek austek force-pushed the issue-4506-artifacttype branch from bf22096 to cf5c28c Compare June 10, 2026 12:34
@acasademont

Copy link
Copy Markdown

Hope this can make it soon, thanks for the fix! 🙏

@acasademont

Copy link
Copy Markdown

@diegomarquezp could this fix be reviewed and hopefully another releaseas for the plugins be tagged soon? Many thx! 🙏

@diegomarquezp

Copy link
Copy Markdown
Contributor

@diegomarquezp could this fix be reviewed and hopefully another releaseas for the plugins be tagged soon? Many thx! 🙏

cc: @whowes @jinseopkim0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unrecognized field "artifactType" during Jib Gradle build

3 participants