-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
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
OPA fails to load bundle when optimizations are enabled #4018
Comments
Interesting, thanks for bringing this up. I wonder what's going on there. split(
__local15__6, __local57__6,
" ",
) should be split(
__local15__6, " ",
__local57__6,
) This could be an issue in the formatter, too, perhaps an unintended side-effect of #3864 🤔 |
Yep definitely related to that formatter change. The formatter is used when a bundle is created to put "pretty" code into the bundle. Here, there are new variables used, and the algorithm that's determining how the arguments are supposed to be laid out breaks when it sees one "real" argument ( |
Fixes open-policy-agent#4018. Signed-off-by: Stephan Renatus <[email protected]>
…4019) Fixes #4018. Signed-off-by: Stephan Renatus <[email protected]>
OPA fails to load bundle when optimizations are enabled.
Expected Behavior
First running
opa build -O=1 . -e rules/main/allowed
and thenopa run -s -b bundle.tar.gz
should successfully start the server.Actual Behavior
The exceptions shown in the image below are thrown:
Here is the corresponding un-optimized rego code:
And the optimized rego code:
Creating the same bundle without optimizations by using
opa build . -e rules/main/allowed
allows the server to be started normally:Steps to Reproduce the Problem
The text was updated successfully, but these errors were encountered: