Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

[BUG] opa.runtime() is returning an empty object #301

@fdaguin

Description

@fdaguin

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"

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions