-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Support index and project exclusions for CPS #139230
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
base: main
Are you sure you want to change the base?
Conversation
|
Pinging @elastic/es-security (Team:Security) |
| // TODO remove me: only used in tests | ||
| public static Map<String, IndexRewriteResult> rewriteIndexExpressions( |
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.
Moved this method to the corresponding test since it's test only.
| // Cannot apply exclusion for both the project and the index | ||
| expectThrows(IllegalArgumentException.class, () -> rewriteIndexExpressions(origin, linked, "-_origin:-metrics*")); | ||
| expectThrows(IllegalArgumentException.class, () -> rewriteIndexExpressions(origin, linked, "-P0:-metrics*")); | ||
| expectThrows(IllegalArgumentException.class, () -> rewriteIndexExpressions(origin, linked, "-P1:-metrics*")); |
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.
NIT: Consider using org.elasticsearch.test.ESTestCase#expectThrows that can assert error message as well
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.
TIL. Pushed 78d2d86
|
Is this updating only CPS |
It should be reflected in both |
Is it going to be reflected when running in non CPS mode? |
If CPS is disabled, |
Add general support for index and project exclusions for the CPS index resolution process. Exclusion follows the same flat-world resolution model so that an expression such as
-fooexcludefoofrom matching projects.Note it currently throws exception on following cases:
*(existing rule)Other than the first case, we might want to discuss relaxing other cases in the future.
Relates: ES-12692