memoize policy instead of revaluate #709
Replies: 2 comments 2 replies
-
Unless your shared support function calls a non-deterministic built-in function (e.g. |
Beta Was this translation helpful? Give feedback.
-
That function should not be too expensive in the first place, unless you have thousands of path components in your parse_spiffe_uri(spiffe_uri) := {"ns": ns, "sa": sa} if { you'd do: parse_spiffe_uri(spiffe_uri) := [ns, sa] { But again, that's unlikely a bottleneck. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys, is there a way for optimize a shared piece of code across multiple policies?
For example I have function that is a bit expensive and I need reuse same code over multiple policies but want avoid reevaluate this because would be same input.
shared.rego
and I have another 3 more files that use
shared.rego
in another sub-policies.I don't want big policy with all code write inside of a single policy, it would be a pain for reuse it, how can I do
parsed_destination_spiffe
to not be recomputed for same input ?Beta Was this translation helpful? Give feedback.
All reactions