We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As per the Image Spec, Platform field is optional. However the below code will cause a panic at https://github.com/oras-project/oras-go/blob/main/internal/platform/platform.go#L40 if there is no platform in the manifest list.
for _, m := range manifests { if Match(m.Platform, p) { return m, nil } }
panic({0x1a09720, 0x2ccc1f0}) │ /usr/local/go/src/runtime/panic.go:884 +0x213 │ oras.land/oras-go/v2/internal/platform.Match(0x0, 0xc000eecd20) │ /home/dev/ws/build/.cache/go-mod/pkg/mod/oras.land/oras-go/v2@v2.3.1/internal/platform/platform.go:41 +0x39 │ oras.land/oras-go/v2/internal/platform.SelectManifest({_, }, {, }, {{0xc0006272f0, 0x27}, {0xc0007b0f50, 0x47}, 0xf68, {0x0, ...}, ...}, ...) │ /home/dev/ws/build/.cache/go-mod/pkg/mod/oras.land/oras-go/v2@v2.3.1/internal/platform/platform.go:88 +0x68b │ oras.land/oras-go/v2.(*CopyOptions).WithTargetPlatform.func1({, }, {, }, {{0xc0006272f0, 0x27}, {0xc0007b0f50, 0x47}, 0xf68, {0x0, ...}, ...}) │ /home/dev/ws/build/.cache/go-mod/pkg/mod/oras.land/oras-go/v2@v2.3.1/copy.go:78 +0x23e │ oras.land/oras-go/v2.Copy({0x1f2ca58, 0xc00005c058}, {0x1f2b750, 0xc0009980b0}, {0xc0003c7990, 0x6}, {, _}, {0x0, 0x0}, ...) │ /home/dev/ws/build/.cache/go-mod/pkg/mod/oras.land/oras-go/v2@v2.3.1/copy.go:143 +0x430
The text was updated successfully, but these errors were encountered:
This is indeed a bug. Thank you @soumiksamanta for catching this!
Sorry, something went wrong.
oras manifest fetch
--platform
fix: fix the potential panic error if there is no platform in the ind…
fa548ab
…ex or manifest list (#695) resolves #692 Signed-off-by: Zoey Li <zoeyli@microsoft.com>
Successfully merging a pull request may close this issue.
As per the Image Spec, Platform field is optional.
However the below code will cause a panic at https://github.com/oras-project/oras-go/blob/main/internal/platform/platform.go#L40 if there is no platform in the manifest list.
The text was updated successfully, but these errors were encountered: