8000 feat: validate serviceMonitor selector labels to prevent reconciliation failures by slashpai · Pull Request #7916 · prometheus-operator/prometheus-operator · GitHub
[go: up one dir, main page]

Skip to content

Conversation

slashpai
Copy link
Contributor
@slashpai slashpai commented Sep 16, 2025

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.

If it fixes an existing issue (bug or feature), use the following keyword:

When Prometheus resources contain serviceMonitorSelector/serviceMonitorNamespaceSelector
with invalid label keys/values (>63 chars or invalid characters),
reconciliation would fail

This change adds validation before selector processing to gracefully handle
invalid selectors and provide clear error messages.

Related-to: #7915

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.

CHANGE/BUGFIX: validate serviceMonitor selector labels to prevent reconciliation failures

@slashpai slashpai marked this pull request as ready for review October 8, 2025 07:56
@slashpai slashpai requested a review from a team as a code owner October 8, 2025 07:56
@slashpai slashpai changed the title fix: add cel validation for label selectors feat: validate serviceMonitor selector labels to prevent reconciliation failures Oct 8, 2025
@slashpai slashpai force-pushed the label-validate branch 2 times, most recently from 9edbc75 to 15b3e4b Compare October 8, 2025 08:05
…on failures

When Prometheus resources contain serviceMonitorSelector/serviceMonitorNamespaceSelector
with invalid label keys/values (>63 chars or invalid characters),
reconciliation would fail

This change adds validation before selector processing to gracefully handle
invalid selectors and provide clear error messages.

Related-to: prometheus-operator#7915

Assisted-by: Cursor
Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0