Skip to content

feat: add logical_op support to grep filter#1903

Merged
cw-Guo merged 3 commits into
fluent:masterfrom
majiayu000:feat/issue-1316-grep-logical-op
Mar 21, 2026
Merged

feat: add logical_op support to grep filter#1903
cw-Guo merged 3 commits into
fluent:masterfrom
majiayu000:feat/issue-1316-grep-logical-op

Conversation

@majiayu000
Copy link
Copy Markdown
Contributor

Fixes #1316

Changes

  • Added LogicalOp field to the Grep filter struct with +kubebuilder:validation:Enum:=and;or validation
  • Updated Params() method to render Logical_Op in the generated Fluent Bit config
  • Added test case verifying Logical_Op appears correctly in rendered config
  • Regenerated CRD manifests and docs

Test Plan

  • Added test in clusterfilter_types_test.go with Regex, Exclude, and LogicalOp fields set
  • Verified make test passes
  • Verified make manifests regenerates CRDs with the new logicalOp enum field

Add LogicalOp field to the Grep filter CRD spec to allow configuring
the logical operation for multiple regex/exclude rules. Fluent Bit
supports this natively via the Logical_Op parameter.

Closes fluent#1316

Signed-off-by: majiayu000 <1835304752@qq.com>
Include generated CRD schema changes for the logicalOp enum field
in Helm chart templates, CRD bases, and setup manifests. Add test
coverage for LogicalOp "or" value and empty-string omit case.
Update doc to list valid enum values.

Signed-off-by: majiayu000 <1835304752@qq.com>
@majiayu000 majiayu000 marked this pull request as ready for review March 17, 2026 10:19
@cw-Guo
Copy link
Copy Markdown
Collaborator

cw-Guo commented Mar 20, 2026

Hi @majiayu000 can you fix the docs difference? you can run make docs-update and compare. Thanks.

Signed-off-by: majiayu000 <1835304752@qq.com>
Copy link
Copy Markdown
Collaborator

@cw-Guo cw-Guo left a comment

Choose a reason for hiding this comment

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

LGTM

@cw-Guo cw-Guo merged commit b2d9757 into fluent:master Mar 21, 2026
13 checks passed
@cw-Guo
Copy link
Copy Markdown
Collaborator

cw-Guo commented Mar 21, 2026

Thank you!

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.

Allow grep filter logical_op

2 participants