Skip to content
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

rego: Fix panic when partial evaluating w/ tracers #2011

Merged
merged 1 commit into from
Jan 22, 2020

Conversation

patrick-east
Copy link
Contributor

There was a typo from a while back that caused problems with this. It
would only occur in cases where the Rego object was created without
tracers, prepared, and then partially evaluated with tracers supplied
as part of the evaluation context. Any of the other code paths would
actually work as the original Rego object would still have them and
the (wrong) reference wouldn't cause a panic.

At some point more recently we changed opa eval to split up its
options for the Rego object and evaluation. Doing this caused the
problem to surface when doing anything with opa eval -p --explain ..

Fixes: #2007
Signed-off-by: Patrick East east.patrick@gmail.com

There was a typo from a while back that caused problems with this. It
would only occur in cases where the Rego object was created without
tracers, prepared, and then partially evaluated with tracers supplied
as part of the evaluation context. Any of the other code paths would
actually work as the original Rego object would still have them and
the (wrong) reference wouldn't cause a panic.

At some point more recently we changed `opa eval` to split up its
options for the Rego object and evaluation. Doing this caused the
problem to surface when doing anything with `opa eval -p --explain ..`

Fixes: open-policy-agent#2007
Signed-off-by: Patrick East <east.patrick@gmail.com>
@patrick-east patrick-east requested a review from tsandall January 16, 2020 21:44
Copy link
Member

@tsandall tsandall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@patrick-east patrick-east merged commit 9b7c645 into open-policy-agent:master Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic: rego package panics when partial evaluation is executed with tracing enabled
2 participants