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
torin:~/scratch/rego-v1-exp$ cat x.rego
package foo
p := 7 if { 3 < 4 }
Building a bundle with --v1-compatible and then running the REPL with the bundle produces an error:
torin:~/scratch/rego-v1-exp$ opa build --v1-compatible x.rego
torin:~/scratch/rego-v1-exp$ opa run -b bundle.tar.gz
OPA 0.67.0-dev (commit b8a7809d9975d54b6d675f66300da3da6d89b99b-dirty, built at 2024-07-02T13:11:57Z)
Run 'help' to see a list of commands and check for updates.
> data
2 errors occurred:
bundle.tar.gz/x.rego:3: rego_parse_error: var cannot be used for rule name
bundle.tar.gz/x.rego:3: rego_parse_error: rule name conflicts with built-in function
Note opa run -s -b ... and opa eval work fine.
EDIT:
You can run workaround this REPL bug by specifying opa run --v1-compatible ... when starting the REPL. This works as long as all bundles you are loading are v1 compatible.
The text was updated successfully, but these errors were encountered:
This change updates the repl so that the modules in the
provided bundle are parsed based on the `rego_version` attribute
in the bundle manifest. Currently that is ignored which leads
to parsing failures.
Fixes: open-policy-agent#6872
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
This change updates the repl so that the modules in the
provided bundle are parsed based on the `rego_version` attribute
in the bundle manifest. Currently that is ignored which leads
to parsing failures.
Fixes: #6872
Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
It seems the REPL has trouble with the rego_version field:
x.rego is v1 compatible.
Building a bundle with --v1-compatible and then running the REPL with the bundle produces an error:
Note
opa run -s -b ...
andopa eval
work fine.EDIT:
You can run workaround this REPL bug by specifying
opa run --v1-compatible ...
when starting the REPL. This works as long as all bundles you are loading are v1 compatible.The text was updated successfully, but these errors were encountered: