opa
opa copied to clipboard
Running `inspect` on a WASM bundle fails if the bundle contains an annotation with the `related_resources` metadata field
Short description
Running opa inspect
on a built WASM bundle that has the following related_resources
annotation:
package main
import data.meta.foo
# METADATA
# entrypoint: true
# related_resources:
# - ref: https://google.com
# description: Some description
zone_alias := foo
Will fail with the following message:
error: bundle bundle.tar.gz: bundle load failed on manifest decode: json: cannot unmarshal string into Go struct field RelatedResourceAnnotation.wasm.annotations.related_resources.ref of type url.URL
Steps To Reproduce
- Clone the following repo: https://github.com/dxh9845/opa-broken-wasm-build-poc/tree/dherzig/broken-annotations
git clone https://github.com/dxh9845/opa-broken-wasm-build-poc.git
- Checkout the branch containing the broken behavior:
git checkout dherzig/broken-annotations
- Run
make fail
to build the bundle and see the failure:
make fail
Expected behavior
OPA can inspect the built WASM bundle without an error.
Additional context
This works for OPA packages built for rego
. However, the WASM implementation seemingly cannot handle