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
It's fine for the Rego to still construct the violation binding, what we care about is using Go to get the values that are already in the Result's Expressions.
This is what the rego.Result type looks like as returned by eval:
Note that all that bindings does is provide us a convenient place to get msg from when it's already present in expressions. So we can just fetch the message from expressions. Later (in a different issue), this means we'll be able to remove the result bindings definition in Rego from gatekeeper.
Specifically: in local.Driver.Query(), for each Expression in each rego.Result in rs, add an element to var results []*types.Result if text is "data.hooks.violation[result]" which contains the contents of "value.msg".
The test code shouldn't need to change for this (unless you're just making it easier to read).
The text was updated successfully, but these errors were encountered:
Moved out of the "Rego Environment Sharding" milestone as environment sharding is required to do this properly. It isn't until we're running one query per Constraint that we can do all of this within Go.
Don't modify Rego code for this!
It's fine for the Rego to still construct the violation binding, what we care about is using Go to get the values that are already in the Result's Expressions.
This is what the
rego.Result
type looks like as returned byeval
:Note that all that
bindings
does is provide us a convenient place to getmsg
from when it's already present inexpressions
. So we can just fetch the message fromexpressions
. Later (in a different issue), this means we'll be able to remove the result bindings definition in Rego from gatekeeper.Specifically: in
local.Driver.Query()
, for eachExpression
in eachrego.Result
inrs
, add an element tovar results []*types.Result
iftext
is"data.hooks.violation[result]"
which contains the contents of "value.msg".The test code shouldn't need to change for this (unless you're just making it easier to read).
The text was updated successfully, but these errors were encountered: