Skip to content

Conversation

@marcofranssen
Copy link
Collaborator

@marcofranssen marcofranssen commented Oct 3, 2025

  • Refactor cyclomatic complexity for fluentbit plugins
  • Refactor cyclomatic complexity for fluentbitconfig controller

Relates to #1707

@marcofranssen marcofranssen force-pushed the fix-cyclo-complexity branch 2 times, most recently from df78188 to 7f49a0d Compare October 6, 2025 16:52
@marcofranssen marcofranssen marked this pull request as ready for review October 6, 2025 16:52
@marcofranssen marcofranssen force-pushed the fix-cyclo-complexity branch 4 times, most recently from 4457093 to 16a83b3 Compare October 7, 2025 08:03
@marcofranssen marcofranssen force-pushed the fix-cyclo-complexity branch 2 times, most recently from c07c23c to 9f6b95f Compare October 7, 2025 08:14
@marcofranssen marcofranssen disabled auto-merge October 7, 2025 19:22
@marcofranssen marcofranssen merged commit 28c4240 into fluent:master Oct 7, 2025
10 of 14 checks passed
@marcofranssen marcofranssen deleted the fix-cyclo-complexity branch October 7, 2025 19:23
joshuabaird added a commit to joshuabaird/fluent-operator that referenced this pull request Nov 17, 2025
ClusterParsers and ClusterMultilineParsers are cluster-scoped resources
and should not be filtered by namespace. This bug was introduced in
commit 30cd0c3 (PR fluent#1708) where the code was refactored to use a
listNamespacedResources helper function that incorrectly added namespace
filtering for cluster-scoped resources.

This caused ClusterParsers referenced from namespace-scoped Filters to
not be generated in parsers.conf with their hash-suffixed names, leading
to fluent-bit pods crashlooping with 'requested parser not found' errors.

The fix:
1. Changes the function to use listClusterResources (which doesn't filter
   by namespace) for ClusterParsers and ClusterMultilineParsers.
2. Renames ListNamespacedResources to ListFluentBitConfigResources to
   better reflect that it lists both namespaced and cluster-scoped
   resources needed by a FluentBitConfig.

Note: The original code (pre-refactor) also had a bug where
ClusterMultilineParsers were incorrectly filtered by namespace.

Fixes fluent#1778
joshuabaird added a commit to joshuabaird/fluent-operator that referenced this pull request Nov 17, 2025
ClusterParsers and ClusterMultilineParsers are cluster-scoped resources
and should not be filtered by namespace. This bug was introduced in
commit 30cd0c3 (PR fluent#1708) where the code was refactored to use a
listNamespacedResources helper function that incorrectly added namespace
filtering for cluster-scoped resources.

This caused ClusterParsers referenced from namespace-scoped Filters to
not be generated in parsers.conf with their hash-suffixed names, leading
to fluent-bit pods crashlooping with 'requested parser not found' errors.

The fix:
1. Changes the function to use listClusterResources (which doesn't filter
   by namespace) for ClusterParsers and ClusterMultilineParsers.
2. Renames ListNamespacedResources to ListFluentBitConfigResources to
   better reflect that it lists both namespaced and cluster-scoped
   resources needed by a FluentBitConfig.

Note: The original code (pre-refactor) also had a bug where
ClusterMultilineParsers were incorrectly filtered by namespace.

Fixes fluent#1778

Signed-off-by: Josh Baird <[email protected]>
marcofranssen pushed a commit to joshuabaird/fluent-operator that referenced this pull request Nov 18, 2025
ClusterParsers and ClusterMultilineParsers are cluster-scoped resources
and should not be filtered by namespace. This bug was introduced in
commit 30cd0c3 (PR fluent#1708) where the code was refactored to use a
listNamespacedResources helper function that incorrectly added namespace
filtering for cluster-scoped resources.

This caused ClusterParsers referenced from namespace-scoped Filters to
not be generated in parsers.conf with their hash-suffixed names, leading
to fluent-bit pods crashlooping with 'requested parser not found' errors.

The fix:
1. Changes the function to use listClusterResources (which doesn't filter
   by namespace) for ClusterParsers and ClusterMultilineParsers.
2. Renames ListNamespacedResources to ListFluentBitConfigResources to
   better reflect that it lists both namespaced and cluster-scoped
   resources needed by a FluentBitConfig.

Note: The original code (pre-refactor) also had a bug where
ClusterMultilineParsers were incorrectly filtered by namespace.

Fixes fluent#1778

Signed-off-by: Josh Baird <[email protected]>
marcofranssen pushed a commit that referenced this pull request Nov 18, 2025
…) (#1779)

* Fix ClusterParser namespace filtering bug (#1778)

ClusterParsers and ClusterMultilineParsers are cluster-scoped resources
and should not be filtered by namespace. This bug was introduced in
commit 30cd0c3 (PR #1708) where the code was refactored to use a
listNamespacedResources helper function that incorrectly added namespace
filtering for cluster-scoped resources.

This caused ClusterParsers referenced from namespace-scoped Filters to
not be generated in parsers.conf with their hash-suffixed names, leading
to fluent-bit pods crashlooping with 'requested parser not found' errors.

The fix:
1. Changes the function to use listClusterResources (which doesn't filter
   by namespace) for ClusterParsers and ClusterMultilineParsers.
2. Renames ListNamespacedResources to ListFluentBitConfigResources to
   better reflect that it lists both namespaced and cluster-scoped
   resources needed by a FluentBitConfig.

Note: The original code (pre-refactor) also had a bug where
ClusterMultilineParsers were incorrectly filtered by namespace.

Fixes #1778

Signed-off-by: Josh Baird <[email protected]>

* Fix linting errors.

Signed-off-by: Josh Baird <[email protected]>

---------

Signed-off-by: Josh Baird <[email protected]>
sugaf1204 pushed a commit to sugaf1204/fluent-operator that referenced this pull request Dec 22, 2025
…ent#1778) (fluent#1779)

* Fix ClusterParser namespace filtering bug (fluent#1778)

ClusterParsers and ClusterMultilineParsers are cluster-scoped resources
and should not be filtered by namespace. This bug was introduced in
commit 30cd0c3 (PR fluent#1708) where the code was refactored to use a
listNamespacedResources helper function that incorrectly added namespace
filtering for cluster-scoped resources.

This caused ClusterParsers referenced from namespace-scoped Filters to
not be generated in parsers.conf with their hash-suffixed names, leading
to fluent-bit pods crashlooping with 'requested parser not found' errors.

The fix:
1. Changes the function to use listClusterResources (which doesn't filter
   by namespace) for ClusterParsers and ClusterMultilineParsers.
2. Renames ListNamespacedResources to ListFluentBitConfigResources to
   better reflect that it lists both namespaced and cluster-scoped
   resources needed by a FluentBitConfig.

Note: The original code (pre-refactor) also had a bug where
ClusterMultilineParsers were incorrectly filtered by namespace.

Fixes fluent#1778

Signed-off-by: Josh Baird <[email protected]>

* Fix linting errors.

Signed-off-by: Josh Baird <[email protected]>

---------

Signed-off-by: Josh Baird <[email protected]>
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.

1 participant