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
We would previously lose any builtin functions provided to the Rego
object after partially evaluating it. Upon creating a new Rego
instance from the PartialResult you would have to re-declare them
all again which breaks the simple case of just getting a new Rego
and evaluating. We should, at a minimum, make sure the Rego produced
by the PartialResult is able to be evaluated.
This change just passes along the declarations to the new Rego
instance. Everything is done with internal bits in the rego package
so we could adjust this later on if we want to.
Fixes: open-policy-agent#1792
Signed-off-by: Patrick East <east.patrick@gmail.com>
We would previously lose any builtin functions provided to the Rego
object after partially evaluating it. Upon creating a new Rego
instance from the PartialResult you would have to re-declare them
all again which breaks the simple case of just getting a new Rego
and evaluating. We should, at a minimum, make sure the Rego produced
by the PartialResult is able to be evaluated.
This change just passes along the declarations to the new Rego
instance. Everything is done with internal bits in the rego package
so we could adjust this later on if we want to.
Fixes: #1792
Signed-off-by: Patrick East <east.patrick@gmail.com>
Expected Behavior
Rego
objectPartialResult
from theRego
objectEval
with thePartialResult
ResultSet
Actual Behavior
In step 3 of the Expected Behavior, an error occurs saying
eval_internal_error: unsupported built-in
.Steps to Reproduce the Problem
You can clone my sample repo here and checkout commit
f2a44459aa4d20f61f084431bfe65c7950faa24d
.And error will occur.
Additional Info
If you re-assign the custom built-in when executing
PartialResult#Rego()
, the error goes away. You can see the diff here.As discussed in the Slack thread, this occurs because custom built-ins don't propagate to
PartialResult
s.Related Slack thread:
https://openpolicyagent.slack.com/archives/C1H19LW4F/p1569483116206300
The text was updated successfully, but these errors were encountered: