fluent-operator icon indicating copy to clipboard operation
fluent-operator copied to clipboard

bug: keyDoesNotExist of FluentBit ClusterFilter should be a string and not a map

Open g1franc opened this issue 6 months ago • 2 comments

Describe the issue

The field of the FluentBit ClusterFilter should be a String as FluentBit expect a String and not a MapString https://docs.fluentbit.io/manual/pipeline/filters/modify

Similar FluentBit fields are using a String while other complex fiels are using a Map, as FluentBit expect for them

To Reproduce

Try to create a

Try to set a modify rule with using keyDoesNotExist as below

    - modify:
        conditions:
          - keyDoesNotExist: mykey

It will fail because it expect a map<String,String>

Guess: Current accepted format should be similar to

    - modify:
        conditions:
          - keyDoesNotExist: 
             - mykey: valuethatisnotrelevant
             - anotherkey: withAnotherValueThatIsUseless

Expected behavior

Setting a modify rule with using keyDoesNotExist should accept below format instead:

    - modify:
        conditions:
          - keyDoesNotExist: mykey

Your Environment

- Fluent Operator version: 3.4.0 and sooner (at least 3.0.0)
- Container Runtime: N/A
- Operating system: N/A
- Kernel version: N/A

How did you install fluent operator?

By using Helm chart template rendering and apply the produced yaml with ArgoCD.

Additional context

CRDs, code and Manual page should be adapted to support a single string instead of a map.

g1franc avatar Jun 06 '25 09:06 g1franc

we didn't change this is because we want to avoid breaking changes. It used to require both key and value.

see: https://docs.fluentbit.io/manual/1.0/filter/modify

cw-Guo avatar Jun 06 '25 10:06 cw-Guo

Could I suggest to introduce a new parameter as "string" ? Code would support both the legacy map[string]string and the new "simple" string for some time, with the map being deprecated and then removed after some time. That way, it wouldn't lead to breaking change (only for people making big migration jump) Or for the fluent-operator to support two version of the CRD with the same principe for support/deprecation and removal.

g1franc avatar Jun 06 '25 11:06 g1franc