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

Feature request: proper control over filter order with ordinals #1384

Closed
reegnz opened this issue Oct 25, 2024 · 2 comments · Fixed by #1386
Closed

Feature request: proper control over filter order with ordinals #1384

reegnz opened this issue Oct 25, 2024 · 2 comments · Fixed by #1386

Comments

@reegnz
Copy link
Contributor

reegnz commented Oct 25, 2024

Is your feature request related to a problem? Please describe.

Currently the only way to influence the order of ClusterFilters (and namespaced filters) is to put them in alphabetical order.

Also we cannot have some clusterfilters run after the evaluation of namespaced filters. The order is fixed, first clusterfilters, then namespaced filters.

This makes it difficult to perform some final clusterfilters after all other filters are done and right before sending off to an output.

Describe the solution you'd like

Introduce an ordinal attribute to ClusterFilter and Filter CRD-s.
Ordinal should not be mandatory (for backward compatibility) and the default should be 0.

ClusterFilters should be sorted primarily by ordinal, and secondarily alphabetically.

Filters (namespaced) should be sorted primarily by ordinal and secondarily alphabetically.

Example:

ClusterFilter A: no ordinal specified
ClusterFilter B: ordinal=0
ClusterFilter C: ordinal=-10
ClusterFilter D: ordinal=10

filter chain then looks like:
C-> A -> B -> D

@reegnz reegnz changed the title Proper control over filter order with ordinals Feature request: proper control over filter order with ordinals Oct 25, 2024
@reegnz
Copy link
Contributor Author

reegnz commented Oct 25, 2024

I gave it a go and already have an initial implementation to propose, PR is up in a couple of minutes.

reegnz added a commit to reegnz/fluent-operator that referenced this issue Oct 25, 2024
reegnz added a commit to reegnz/fluent-operator that referenced this issue Oct 25, 2024
Implements fluent#1384

Signed-off-by: Zoltán Reegn <zoltan.reegn@gmail.com>
reegnz added a commit to reegnz/fluent-operator that referenced this issue Oct 25, 2024
Implements fluent#1384

Signed-off-by: Zoltán Reegn <zoltan.reegn@gmail.com>
@reegnz
Copy link
Contributor Author

reegnz commented Oct 25, 2024

An additional annoyance that I think I will put in a different Issue is allowing some clusterfilters to be applied AFTER namespace filters have already been applied.

benjaminhuo pushed a commit that referenced this issue Nov 29, 2024
* feat: filter ordinals

Implements #1384

Signed-off-by: Zoltán Reegn <zoltan.reegn@gmail.com>

* Fix tests

Signed-off-by: Zoltán Reegn <zoltan.reegn@gmail.com>

---------

Signed-off-by: Zoltán Reegn <zoltan.reegn@gmail.com>
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 a pull request may close this issue.

1 participant