Skip to content

Exclude namespaces#30

Merged
piceri merged 6 commits intomainfrom
exclude-namespaces
Feb 3, 2026
Merged

Exclude namespaces#30
piceri merged 6 commits intomainfrom
exclude-namespaces

Conversation

@piceri
Copy link
Contributor

@piceri piceri commented Feb 3, 2026

This PR introduces a -exclude-namespaces flag that accepts a comma separated list of namespaces to exclude from monitoring.

I checked to see if the -namespace flag could also accept a comma separated list but it seems FieldSelector ANDs together multiple values and you cannot OR them together.

@piceri piceri requested a review from a team as a code owner February 3, 2026 20:11
Copilot AI review requested due to automatic review settings February 3, 2026 20:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for excluding specific Kubernetes namespaces from deployment-tracker monitoring via a new CLI flag.

Changes:

  • Extends CLI with -exclude-namespaces and prevents using it together with -namespace.
  • Refactors controller informer setup into createInformerFactory(...) and adds field-selector-based namespace exclusion.
  • Documents the new flag and the mutual exclusivity rule in the README.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
internal/controller/controller.go Refactors informer factory creation and adds field-selector logic to exclude namespaces.
cmd/deployment-tracker/main.go Introduces -exclude-namespaces flag, validation, and passes it into the controller.
README.md Documents the new CLI flag and notes that it can’t be combined with -namespace.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@malancas malancas left a comment

Choose a reason for hiding this comment

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

The copilot comments make sense to me. Looks good overall

@piceri piceri merged commit d6075b6 into main Feb 3, 2026
6 checks passed
@piceri piceri deleted the exclude-namespaces branch February 3, 2026 22:44
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