Skip to content

Conversation

@nutmos
Copy link
Contributor

@nutmos nutmos commented Oct 4, 2025

Description

This PR adds global config validation for WeChat in Alertmanager.

The validation checks the secret is presented.

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

Unit Test (existing test is already covered)

Changelog entry

- Add secret validation for WeChat global config in Alertmanager

@nutmos nutmos marked this pull request as ready for review October 4, 2025 09:48
@nutmos nutmos requested a review from a team as a code owner October 4, 2025 09:48

func checkAlertmanagerGlobalConfigResource(gc *monitoringv1.AlertmanagerGlobalConfig) error {
return validationv1.ValidateAlertmanagerGlobalConfig(gc)
func checkAlertmanagerGlobalConfigResource(
Copy link
Contributor

Choose a reason for hiding this comment

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

can we make it a ConfigBuilder method?

Suggested change
func checkAlertmanagerGlobalConfigResource(
func (cb *ConfigBuidler) checkAlertmanagerGlobalConfigResource(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@simonpasquier I don't have any opinion against this but just want to understand why?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure (sorry for being dense)! It would avoid passing the store parameter since it's already a field of the ConfigBuilder struct.

@nutmos nutmos requested a review from simonpasquier October 7, 2025 12:50
@nutmos
Copy link
Contributor Author

nutmos commented Oct 8, 2025

@simonpasquier Updated. Please have a look.

return monitoringv1ac.Alertmanager(a.Name, a.Namespace).WithStatus(asac)
}

func (cb *ConfigBuilder) checkAlertmanagerGlobalConfigResource(
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit) since it's now a ConfigBuilder method, it would be good to move it to amcfg.go next to the other methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@simonpasquier Updated

@nutmos
Copy link
Contributor Author

nutmos commented Oct 11, 2025

@simonpasquier All requested changes have been updated. Please review.

@nutmos nutmos requested a review from simonpasquier October 11, 2025 14:57
@nutmos
Copy link
Contributor Author

nutmos commented Oct 14, 2025

@simonpasquier Anything you can suggest?

@nutmos
Copy link
Contributor Author

nutmos commented Oct 16, 2025

@simonpasquier Are you able to have a look? Sorry for repeatedly ping you.

@nutmos
Copy link
Contributor Author

nutmos commented Oct 18, 2025

Hi @slashpai , could you please help me review?

@nutmos
Copy link
Contributor Author

nutmos commented Oct 21, 2025

Hi, are you able to have a look? @simonpasquier

@nutmos
Copy link
Contributor Author

nutmos commented Nov 6, 2025

@simonpasquier any chance you can review this please?

@github-actions github-actions bot added the stale label Jan 6, 2026
@nutmos
Copy link
Contributor Author

nutmos commented Jan 7, 2026

@simonpasquier Please review this. Thanks!

to prevent nil pointer exception
@simonpasquier simonpasquier enabled auto-merge (squash) January 7, 2026 13:25
@simonpasquier simonpasquier merged commit 4a393db 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.

2 participants