Describe the bug
The built-in function opa.runtime() is systematically returning an empty object.
How you're running Regula
I'm using Regula 2.4.0 (build b66c18f, built with OPA v0.34.1) as a CLI tool.
Operating System
Ubuntu 20.04.
Steps to reproduce
The easiest way is through the REPL:
❯❯❯ regula repl
Regula 2.4.0 - built with OPA v0.34.1
Run 'help' to see a list of commands.
> opa.runtime()
{}
>
When using OPA instead of Regula to create a new REPL, the same function call is working:
❯❯❯ opa run
OPA 0.37.1 (commit , built at )
Run 'help' to see a list of commands and check for updates.
> opa.runtime()
{
"commit": "",
"config": {},
"env": {
**REDACTED**
},
"version": "0.37.1"
}
>
IaC Configuration
N/A.
Additional context
I want access to environment variables when using Regula..
❯❯❯ FOO="bar" regula repl
Regula 2.4.0 - built with OPA v0.34.1
Run 'help' to see a list of commands.
> opa.runtime().env.FOO
undefined
..as it is supported by OPA:
❯❯❯ FOO="bar" opa run
OPA 0.37.1 (commit , built at )
Run 'help' to see a list of commands and check for updates.
> opa.runtime().env.FOO
"bar"