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

Add ToMatcher to TargetHandler #178

Merged
merged 4 commits into from
Jan 12, 2022

Conversation

willbeason
Copy link
Member

@willbeason willbeason commented Jan 5, 2022

The idea here is that we can cache the golang match criteria for each
Constraint, rather than parsing it out each time. This PR does not actually implement the behavior; it just defines the interface so that we can start using it in Gatekeeper.

Also fix bug in SemanticEqual where one Constraint has Object defined
and the other does not.

Signed-off-by: Will Beason willbeason@google.com

@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2022

Codecov Report

Merging #178 (d6b5c13) into master (527ad40) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #178      +/-   ##
==========================================
+ Coverage   44.92%   44.94%   +0.02%     
==========================================
  Files          59       59              
  Lines        2776     2779       +3     
==========================================
+ Hits         1247     1249       +2     
- Misses       1286     1287       +1     
  Partials      243      243              
Flag Coverage Δ
unittests 44.94% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...t/frameworks/constraint/pkg/client/test_handler.go 76.00% <0.00%> (-3.17%) ⬇️
...rks/constraint/pkg/core/constraints/constraints.go 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 527ad40...d6b5c13. Read the comment docs.

@willbeason
Copy link
Member Author

Failure from Gatekeeper Test is expected as this changes the TargetHandler interface.

Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with 1 nit

constraint/pkg/core/constraints/constraints.go Outdated Show resolved Hide resolved
Will Beason added 3 commits January 12, 2022 08:23
The idea here is that we can cache the golang match criteria for each
Constraint, rather than parsing it out each time.

Also fix bug in SemanticEqual where one Constraint has Object defined
and the other does not.

Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
Signed-off-by: Will Beason <willbeason@google.com>
@willbeason willbeason merged commit 4b0a3de into open-policy-agent:master Jan 12, 2022
@willbeason willbeason deleted the to-matcher branch January 12, 2022 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants