Skip to content

pkg/alertmanager: add URL validation for MSTeams receiver#8231

Merged
simonpasquier merged 1 commit intoprometheus-operator:mainfrom
tomlin7:feat/msteams-url-validation
Jan 7, 2026
Merged

pkg/alertmanager: add URL validation for MSTeams receiver#8231
simonpasquier merged 1 commit intoprometheus-operator:mainfrom
tomlin7:feat/msteams-url-validation

Conversation

@tomlin7
Copy link
Contributor

@tomlin7 tomlin7 commented Dec 31, 2025

Description

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

Validated fields:

  • webhook_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 Webhook URL (msteams invalid webhook_url returns error)
  • Added test case for valid Webhook URL (msteams valid webhook_url passes validation) with golden file
  • 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 MSTeams receiver secrets

@tomlin7 tomlin7 requested a review from a team as a code owner December 31, 2025 14:01
@tomlin7 tomlin7 force-pushed the feat/msteams-url-validation branch from 2b9df27 to 05e2e52 Compare December 31, 2025 16:33
@heliapb
Copy link
Member

heliapb commented Jan 6, 2026

Hi @tomlin7 #8233 (comment) I guess this comment also make sense here, let's get some feedback, otherwise lgtm

simonpasquier
simonpasquier previously approved these changes Jan 7, 2026
@slashpai
Copy link
Contributor

slashpai commented Jan 7, 2026

@tomlin7 can you rebase? likely you might need to rebase other validation prs based on what gets merged first

@tomlin7
Copy link
Contributor Author

tomlin7 commented Jan 7, 2026

@slashpai I'll update this as soon as the MSTeamsV2 pr is handled. Otherwise I'll be facing same conflict again.

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

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

Thanks!

@simonpasquier simonpasquier merged commit a4fbeed into prometheus-operator:main Jan 7, 2026
22 checks passed
@tomlin7
Copy link
Contributor Author

tomlin7 commented Jan 7, 2026

Hi @tomlin7 #8233 (comment) I guess this comment also make sense here, let's get some feedback, otherwise lgtm

@simonpasquier this was pending, but now that it's merged, I guess I can combine all similar changes to one PR.

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.

4 participants