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

Update OPA version #1

Merged
merged 1 commit into from Nov 16, 2022
Merged

Update OPA version #1

merged 1 commit into from Nov 16, 2022

Conversation

aknysh
Copy link

@aknysh aknysh commented Nov 16, 2022

what

  • Update OPA version to the latest

why

  • The latest versions introduced two new strings functions
New Built-in Functions: strings.any_prefix_match and strings.any_suffix_match
This release introduces two new builtins, optimized for bulk matching of string prefixes and suffixes: strings.any_prefix_match, and strings.any_suffix_match. It works with sets and arrays of strings, allowing efficient matching of collections of prefixes or suffixes against a target string.

See [the built-in functions docs for all the details](https://www.openpolicyagent.org/docs/v0.42.0/policy-reference/#builtin-strings-stringsany_prefix_match)

This implementation fixes https://github.com/open-policy-agent/opa/issues/4994 and was authored by @cube2222.
  • The new functions make matching an array of strings with an array of prefixes/suffixes much faster - this speeds up Spacelift policies evaluation. When we use the current startswith and endswith functions in Spacelift OPA policies, Spacelift takes a lot of time and frequently times out when evaluating many stacks at once after a PR is opened that affects many stack files

references

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants