-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
cwd
.
└── bundle
└── p.regobundle/p.rego
package p
a := 1
# METADATA
# description: a
# entrypoint: true
b := 2
# METADATA
# description: b
# entrypoint: true
c := 3opa build -O=1 --bundle bundle/
opa eval -b bundle.tar.gz data.p
{
"errors": [
{
"message": "loading error: bundle bundle.tar.gz: 1 error occurred: /bundle/p.rego:9: rego_parse_error: yaml: line 4: could not find expected ':'\n\t# description: b\n\t^"
}
]
}Looking inside of the optimized bundle, the p.rego file does indeed look broken wrt metadata:
p.rego (inside bundle.tar.gz)
package p
a := 1
# METADATA
# description: a
# entrypoint: true
# METADATA
# description: b
# entrypoint: trueThe b and c rules have been moved to different files under the optimized directory, but since the metadata annotations haven't moved with them, they'll no longer be scoped to those rules.
Interestingly, running opa eval -O=1 --bundle bundle/ — i.e. on the directory directly (without passing opa build) does not produce this error, so presumably it does not do the same optimization?
Reported to me by @nevumx
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Backlog