Remove tag consideration from Fluentd ClusterFilter / Filter order

Abierto
#1,832 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@cvas22 ya está trabajando en esto.

Desde el 11/11/2026.

  • #2125 de @cvas22 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
go, kubernetes
Área
devops

Línea de trabajo

Comienza en apis/fluentd/v1alpha1/plugins/params/model.go, en PluginStoreByNameById.Less. Lee las comparaciones actuales de nombre, etiqueta e ID y, después, evalúa el orden solicitado sin tener en cuenta la etiqueta. Se considera terminado cuando el orden sigue el nombre del filtro y el ID, incluidos los casos en los que ** aparece entre filtros.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Go
Estrellas
689
Forks
333
Merge medio
2 d 14 h
PR fusionados (30 d)
41

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de fluent/fluent-operator

Todos los issues de fluent/fluent-operator

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.