Remove tag consideration from Fluentd ClusterFilter / Filter order

オープン
#1,832 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@cvas22 がすでに取り組んでいます。

2026年11月11日 から。

  • #2125 @cvas22 による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go, kubernetes
領域
devops

調査の方向性

apis/fluentd/v1alpha1/plugins/params/model.go の PluginStoreByNameById.Less から始めます。現在の name、tag、ID の比較を読み、tag を考慮しない場合に要求される順序を確認します。** がフィルター間に現れるケースを含め、順序がフィルター名と ID に従えば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

The filter order logic in fluentd ever since https://github.com/fluent/fluent-operator/pull/1106 can be seen here.
Specifically in:

func (a PluginStoreByNameById) Less(i, j int) bool {
	if a[i].Name == a[j].Name {
		if a[i].GetTag() == "**" && a[j].GetTag() != "**" {
			return false
		}
		if a[i].GetTag() != "**" && a[j].GetTag() == "**" {
			return true
		}
		return a[i].GetId() < a[j].GetId()
	} else {
		return a[i].Name < a[j].Name
	}
}

From reading the code, it seems filters with tag ** will be order last no matter the id (which matches my experience).
My argument is that the current ordering is problematic and unintuitive.

Describe the solution you'd like

The more initiative ordering, is to consider the filter k8s name, and then if a ClusterFilter / Filter contains a list of several filters, it should add them in order.
This seems to already happen inside return a[i].GetId() < a[j].GetId(), so the only thing left is to remove the GetTag section.

I understand that this is a breaking change, but the current ordering prevent having ** in as a middle filter, which is useful.
I think this should either be a breaking change in version v4, or add a parameter for the deployment to disable tag ordering.

Workaround

Using customPlugin with some placeholder tag, and then setting the filter to ** in the config section.

Additional context

No response

主要言語
Go
スター
689
フォーク
333
平均マージ
2日 14時間
マージ済み PR(30日)
41

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fluent/fluent-operator のほかの issue

fluent/fluent-operator の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。