oras push --artifact-platform
is not compatible with oras pull --platform
and similar commands
#1517
Closed
1 task done
What happened in your environment?
The PR #1500 introduced a new
--artifact-platform
option to theoras push
command, which adds platform information to the artifact configuration using the media type"application/vnd.unknown.config.v1+json"
by default.However, this implementation of
oras push --artifact-platform
is incompatible with other commands that provide the--platform
option, such asoras pull --platform
,oras manifest fetch-config --platform
, andoras copy --platform
.Symptom
For example, if one pushes an artifact with platform metadata like this:
and then pulls it specifying the platform as well:
They would get this error message:
Root Cause
This is because the
oras-go
backing library only extracts platform information from the image config media type"application/vnd.oci.image.config.v1+json"
and throws errors for any other config media type.Workaround
To temporarily address this issue, we can use
"application/vnd.oci.image.config.v1+json"
as the default config media type. While this solution is not ideal and introduces other problems, it serves as a workaround to enable the end-to-end workflow. Ultimately, we may need to reconsider the design for adding the platform information.What did you expect to happen?
No response
How can we reproduce it?
Push an artifact with platform information:
Pull the same artifact specifying the platform:
What is the version of your ORAS CLI?
Version: 1.2.0+unreleased
Go version: go1.23.0
Git commit: 97cb376
Git tree state: clean
What is your OS environment?
Ubuntu 22.04.1
Are you willing to submit PRs to fix it?
The text was updated successfully, but these errors were encountered: