-
Notifications
You must be signed in to change notification settings - Fork 769
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
feat: Support suffix-based matching for resources #1796
feat: Support suffix-based matching for resources #1796
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Overall shape looks good, though I didn't have time to finish a close review. One nit that I can find so far.
open-policy-agent#1796 (comment) Signed-off-by: Sunghoon Kang <[email protected]>
ad8d595
to
17fa858
Compare
Can we update e2e to cover prefix (or suffix) match too? https://github.com/open-policy-agent/gatekeeper/blob/master/test/bats/tests/sync_with_exclusion.yaml#L9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
open-policy-agent#1796 (comment) Signed-off-by: Sunghoon Kang <[email protected]>
open-policy-agent#1796 (comment) Signed-off-by: Sunghoon Kang <[email protected]>
open-policy-agent#1571 It would be useful to allow suffix-based matching for resource names, in addition to prefix-based matching. This commit implements this feature by extending `PrefixWildcard` type instead of using regex since it might be problematic for large numbers of resources as @maxsmythe commented on the issue. Signed-off-by: Sunghoon Kang <[email protected]>
open-policy-agent#1796 (comment) Signed-off-by: Sunghoon Kang <[email protected]>
open-policy-agent#1796 (comment) Signed-off-by: Sunghoon Kang <[email protected]>
open-policy-agent#1796 (comment) Signed-off-by: Sunghoon Kang <[email protected]>
71f7757
to
5af3a52
Compare
Codecov Report
@@ Coverage Diff @@
## master #1796 +/- ##
==========================================
- Coverage 52.08% 52.03% -0.05%
==========================================
Files 99 99
Lines 8821 8828 +7
==========================================
Hits 4594 4594
- Misses 3865 3870 +5
- Partials 362 364 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! LGTM
What this PR does / why we need it:
It would be useful to allow suffix-based matching for resource names, in addition to prefix-based matching.
This commit implements this feature by extending
PrefixWildcard
type instead of using regex since it might be problematic for large numbers of resources as @maxsmythe commented on the issue.Which issue(s) this PR fixes:
Fixes #1571
Special notes for your reviewer:
None