Pulling multi-arch image index fails incorrect validation
I am attempting to fetch an attached artifact via the Java SDK give the image name and tag.
For example, I have a change log attached to the image coordinates in the repo with type 'application/vnd.demo.changelog'
> oras discover myrepo.local/jenkins-uat/demo/webapp:1.0.0
myrepo.local/demo/webapp@sha256:b84c2dd1c79bb1e978fc83c8811d452b875b0c303d18f25df32b3627c9d09a85
└── application/vnd.demo.changelog
└── sha256:4cf2df0f131ebeb47ed86864389056492fa1a0f7d13950219ed446b3253e8dee
└── [annotations]
└── org.opencontainers.image.created: "2026-02-04T08:47:55Z"
I want to fetch the change log file from my deployment tooling (which is in Java) give the image, in this case myrepo.local/jenkins-uat/demo/webapp:1.0.0
My approach for doing this is to get the Index from registry.getIndex() for the multi arch image myrepo.local/jenkins-uat/demo/webapp:1.0.0 is pointing to, then find the digest of the first nested manifest, and use that to call registry.getReferrers() which requires a digest to find the artifact I need.
However this failed at the first step of getting the index with this:
Exception in thread "main" java.lang.NullPointerException
at java.base/java.util.Objects.requireNonNull(Objects.java:233)
at land.oras.ManifestDescriptor.of(ManifestDescriptor.java:191)
at land.oras.Registry.getIndex(Registry.java:575)
Based on the OCI image spec for image index manifest, the manifest looks like this.
{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.index.v1+json",
"manifests": [
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"size": 7143,
"digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f",
"platform": {
"architecture": "ppc64le",
"os": "linux"
}
},
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"size": 7682,
"digest": "sha256:5b0bcabd1ed22e9fb1310cf6c2dec7cdef19f0ad69efa1f392e94a4333501270",
"platform": {
"architecture": "amd64",
"os": "linux"
}
}
],
"annotations": {
"com.example.key1": "value1",
"com.example.key2": "value2"
}
}
This does not have a digest field at the top of the JSON document, however the code in getIndex() method in Registry tries to parse this manifest via ManifestDescriptor.of(...) which checks to see if there's a digest which does not exist.
Seems like getIndex() response requiring a digest seems incorrect. It could be that my approach for getting to the referrers is incorrect? If so appreciate any help in how it should be done.