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
Now that we've copied over matching logic into frameworks, and callers explicitly call "AddConstraint" and "RemoveConstraint", we can start doing bookkeeping in local.Driver which we need to have in order to move matching from Rego to Go. For this issue, we're just keeping a copy of the matchers for each Constraint.
Add a field to local.Driver called matchers. You can probably make this a map similar to the following:
type matcherKey struct {
Kind, Name string
}
type Driver struct {
...
matchers map[matcherKey]*Matcher
}
All that needs to happen is when Constraints are added to the Driver, we unmarshal the Matcher field into the Matcher type we copied over previously. Use the bytes := json.Marshal(unstructured) and json.Unmarshal(bytes, matcher) pattern used elsewhere to conver to the Match type.
We can't actually use these matchers yet since we haven't sharded the compilation environment - but we need these ready for when we do.
The text was updated successfully, but these errors were encountered:
Prerequisites: #175 and #170
Now that we've copied over matching logic into frameworks, and callers explicitly call "AddConstraint" and "RemoveConstraint", we can start doing bookkeeping in
local.Driver
which we need to have in order to move matching from Rego to Go. For this issue, we're just keeping a copy of the matchers for each Constraint.Add a field to
local.Driver
calledmatchers
. You can probably make this a map similar to the following:All that needs to happen is when Constraints are added to the Driver, we unmarshal the Matcher field into the Matcher type we copied over previously. Use the
bytes := json.Marshal(unstructured)
andjson.Unmarshal(bytes, matcher)
pattern used elsewhere to conver to theMatch
type.We can't actually use these matchers yet since we haven't sharded the compilation environment - but we need these ready for when we do.
The text was updated successfully, but these errors were encountered: