You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
oras push --artifact-platform is not compatible with oras pull --platform and similar commands #1517
The PR #1500 introduced a new --artifact-platform option to the oras 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 as oras pull --platform, oras manifest fetch-config --platform, and oras copy --platform.
Symptom
For example, if one pushes an artifact with platform metadata like this:
Error: fail to recognize platform from unknown config application/vnd.unknown.config.v1+json: expect application/vnd.oci.image.config.v1+json
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.
Checked the oras-go function that does the platform matching, sounds like --artifact-type should not be used with --aritfact-platform for when image spec is set tov1.0
Activity
qweeah commentedon Oct 29, 2024
Checked the oras-go function that does the platform matching, sounds like
--artifact-typeshould not be used with--aritfact-platformfor when image spec is set tov1.0