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

bug: The filter is created in the incorrect order.

Open onap4105 opened this issue 2 years ago • 1 comments

Describe the issue

I attempted to create the filter order as shown below, but the order ended up reversed. I tested by creating the second filter 2-3 minutes after the first filter, but the later-created filter still appeared in front of the first filter. [Filter] Name rewrite_tag Match kube.* Rule $kubernetes['namespace_name'] hwapp-ns hwapp_ns_tag true Emitter_Name hwapp_ns [Filter] Name rewrite_tag Match hwapp_ns_tag Rule $log (log-pattern) app_log_tag true Emitter_Name hwapp_log

To Reproduce

created following manifest files and applied one by one

kind: ClusterFilter metadata: name: kubernetes-hwapp-ns annotations: meta.helm.sh/release-name: fluent-operator meta.helm.sh/release-namespace: fluentbit labels: app.kubernetes.io/managed-by: Helm fluentbit.fluent.io/enabled: "true" fluentbit.fluent.io/component: logging spec: match: kube.* filters:

  • rewriteTag: emitterName: hwapp_ns rules:
    • $kubernetes['namespace_name'] hwapp-ns hwapp_ns_tag true

apiVersion: fluentbit.fluent.io/v1alpha2 kind: ClusterFilter metadata: name: kubernetes-hwapp-log annotations: meta.helm.sh/release-name: fluent-operator meta.helm.sh/release-namespace: fluentbit labels: app.kubernetes.io/managed-by: Helm fluentbit.fluent.io/enabled: "true" fluentbit.fluent.io/component: logging spec: match: hwapp_ns_tag filters:

  • rewriteTag: emitterName: hwapp_log rules:
    • $log (log-pattern) app_log_tag true

Expected behavior

see this order in secret fluent-bit-config fluent-bit.conf [Filter] Name rewrite_tag Match kube.* Rule $kubernetes['namespace_name'] hwapp-ns hwapp_ns_tag true Emitter_Name hwapp_ns [Filter] Name rewrite_tag Match hwapp_ns_tag Rule $log (log-pattern) app_log_tag true Emitter_Name hwapp_log

Your Environment

- Fluent Operator version:v2.1.0
- Container Runtime:v2.0.9
- Operating system: Ubuntu 1.25
- Kernel version:

How did you install fluent operator?

No response

Additional context

No response

onap4105 avatar Sep 18 '23 23:09 onap4105

This is actually not a bug.

the resources are ordered lexicographically by the resource metadata.name currently.

check https://github.com/fluent/fluent-operator/issues/693#issuecomment-1545471232

cw-Guo avatar Oct 23 '23 02:10 cw-Guo