Skip to content

fix(alertmanager, framework): use named ports for services#7517

Merged
simonpasquier merged 3 commits intoprometheus-operator:mainfrom
miinsun:refactor-service-targetport
Aug 19, 2025
Merged

fix(alertmanager, framework): use named ports for services#7517
simonpasquier merged 3 commits intoprometheus-operator:mainfrom
miinsun:refactor-service-targetport

Conversation

@miinsun
Copy link
Contributor

@miinsun miinsun commented May 9, 2025

Use named ports instead of hard-coded port numbers in Alertmanager manifests and framework tests.

Fixes #7491

Description

Since Prometheus and Thanos services already use named ports for their targetPort, only Alertmanager needed to be updated. Additionally, some framework test examples specified targetPort as an integer, so those have been changed to use the named port approach as well.

  • pkg/alertmanager/statefulset.go
  • test/framework/framework.go
  • test/framework/probe.go

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

All existing unit tests pass successfully

Changelog entry

Use named ports for all services instead of hard-coded port numbers.

@miinsun miinsun requested a review from a team as a code owner May 9, 2025 16:55
@github-actions github-actions bot added the stale label Jul 9, 2025
@yp969803
Copy link
Contributor

yp969803 commented Jul 9, 2025

ping @miinsun

@github-actions github-actions bot removed the stale label Jul 10, 2025
@miinsun
Copy link
Contributor Author

miinsun commented Jul 16, 2025

hello @yp969803 I’ve made the changes you suggested 😊

@yp969803
Copy link
Contributor

LGTM!

@yp969803
Copy link
Contributor

@simonpasquier @mviswanathsai @slashpai merge request !!

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.

Can we add the values as const since the container port definitions need to use the same values?

@miinsun miinsun force-pushed the refactor-service-targetport branch from d099208 to 68045ee Compare August 15, 2025 10:07
Use named ports instead of hard-coded port numbers in Alertmanager manifests and framework tests.

Fixes prometheus-operator#7491

Signed-off-by: miinsun <kor3334@naver.com>
Signed-off-by: miinsun <kor3334@naver.com>
@miinsun miinsun force-pushed the refactor-service-targetport branch from 68045ee to 23da707 Compare August 15, 2025 10:14
Signed-off-by: miinsun <kor3334@naver.com>
@miinsun
Copy link
Contributor Author

miinsun commented Aug 16, 2025

ping @simonpasquier — I’ve addressed your feedback.

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 e111cbd into prometheus-operator:main Aug 19, 2025
23 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.

Use port names rather than port numbers for services

4 participants