Skip to content

Conversation

bennyyang11
Copy link
Contributor

@bennyyang11 bennyyang11 commented Oct 9, 2025

Description, Motivation and Context

Fixes an issue where scheduled support bundle jobs fail on Windows when using auto-discovery mode (--auto flag).

Problem:
When auto-discovery creates collectors with wildcard selectors (e.g., []string{"*"} to collect all configmaps/secrets), the * character is used in error filenames like configmaps-errors/default/*.json. Windows filesystems do not allow * in filenames, causing the scheduled job to fail with: CreateFile ...configmaps-errors\default*.json: The filename, directory name, or volume label syntax is incorrect.

Solution:
Modified selectorToString() in pkg/collect/util.go to sanitize Windows-invalid filename characters (< > : " / \ | ? *):

  • * is replaced with all (semantic: "all resources")
  • Other invalid characters are replaced with _

This ensures cross-platform compatibility for scheduled jobs while maintaining semantic clarity in filenames.

Testing:

  • Verified on Windows 11 with scheduled jobs
  • Support bundles now generate successfully on Windows
  • Filenames changed from configmaps-errors/default/*.json to configmaps-errors/default/all.json

Checklist

  • New and existing tests pass locally with introduced changes.
  • Tests for the changes have been added (for bug fixes / features)

Does this PR introduce a breaking change?

  • Yes
  • No

@bennyyang11 bennyyang11 added the type::feature New feature or request label Oct 9, 2025
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@NoaheCampbell NoaheCampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@bennyyang11 bennyyang11 merged commit df40c66 into main Oct 10, 2025
21 checks passed
@bennyyang11 bennyyang11 deleted the fix-windows-cronjob branch October 10, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type::feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants