Skip to content

Conversation

@tomlin7
Copy link
Contributor

@tomlin7 tomlin7 commented Dec 31, 2025

Description

Adds URL validation for Webhook receiver configuration fields when loaded from secrets. This ensures URLs are validated regardless of whether configurations come from CustomResources or secrets.

Validated fields:

  • url

Relates to #8193

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

  • Added test case for invalid URLs (Test invalid url returns error)
  • Added test case for valid URLs (Test valid url passes validation)
  • Fixed existing test that used invalid URL (Test url takes precedence now uses http://example.com/foo)
  • All tests pass

Changelog entry

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

Add URL validation for Webhook receiver secrets

Adds URL validation for Webhook receiver configuration fields when loaded from
secrets. This ensures URLs are validated regardless of whether configurations
come from CustomResources or secrets.
@tomlin7 tomlin7 requested a review from a team as a code owner December 31, 2025 13:27
Copy link
Member

@heliapb heliapb left a comment

Choose a reason for hiding this comment

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

lgtm

@simonpasquier simonpasquier merged commit a9eb681 into prometheus-operator:main Jan 7, 2026
22 checks passed
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.

3 participants