Skip to content

Conversation

@xavpaice
Copy link
Member

  • Fix issue where EnsureClusterResourcesFirst ordering was lost when collectors were grouped by type into a map (Go maps have random iteration order)
  • Preserve collector type order by tracking collectorTypeOrder slice as collectors are added to the map
  • Apply fix to both pkg/preflight/collect.go and pkg/supportbundle/collect.go
  • Add comprehensive tests to verify clusterResources runs first and relative order of other collectors is preserved
  • Enhance EnsureClusterResourcesFirst tests with additional edge cases

Does this PR introduce a breaking change?

  • Yes
  • No

- Fix issue where EnsureClusterResourcesFirst ordering was lost when
  collectors were grouped by type into a map (Go maps have random
  iteration order)
- Preserve collector type order by tracking collectorTypeOrder slice
  as collectors are added to the map
- Apply fix to both pkg/preflight/collect.go and
  pkg/supportbundle/collect.go
- Add comprehensive tests to verify clusterResources runs first and
  relative order of other collectors is preserved
- Enhance EnsureClusterResourcesFirst tests with additional edge cases
@xavpaice
Copy link
Member Author

note, this does not address the deduplication for clusterResources, we didn't do that originally because we're likely to have parameters. That's a separate change if we want it.

@xavpaice xavpaice merged commit e45e2ca into main Nov 26, 2025
20 checks passed
@xavpaice xavpaice deleted the xp/fix-collector-order branch November 26, 2025 02:34
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.

3 participants