Skip to content

alertmanager: add several secret-file fields#8537

Open
cjyar wants to merge 5 commits into
prometheus-operator:mainfrom
cjyar:discord-secret-file
Open

alertmanager: add several secret-file fields#8537
cjyar wants to merge 5 commits into
prometheus-operator:mainfrom
cjyar:discord-secret-file

Conversation

@cjyar

@cjyar cjyar commented Apr 25, 2026

Copy link
Copy Markdown

Discord and MS Teams have webhook_url_file fields in alertmanager, but those fields aren't supported by the operator. I checked all of the secret-file style fields in the alertmanager docs, and these were the only two missing that I found. I also reordered fields for weChat.

Description

Alertmanager has webhook_url_file fields for Discord and MS Teams, but those fields aren't supported by the operator. This PR adds that support.

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

I haven't tested this; sorry. I don't have a suitable system for running tests. I'm typing this on a Windows box.

Changelog entry

- Add support for `webhook_url_file` in Discord and MS Teams.

Discord and MS Teams have webhook_url_file fields in alertmanager, but
those fields aren't supported by the operator. I checked all of the
secret-file style fields in the alertmanager docs, and these were the
only two missing that I found. I also reordered fields for weChat.
@cjyar cjyar requested a review from a team as a code owner April 25, 2026 21:36
Comment thread pkg/alertmanager/types.go
VSendResolved *bool `yaml:"send_resolved,omitempty"`
HTTPConfig *httpClientConfig `yaml:"http_config,omitempty"`
WebhookURL string `yaml:"webhook_url,omitempty"`
WebhookURLFile string `yaml:"webhook_url_file,omitempty"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Need set/get function and add it crd

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@dongjiang1989 I don't see set/get functions for other similar fields (like victorOpsConfig.APIKeyFile). Can you please show me where those are?

Also, I don't believe this change requires any modification to the AlertmanagerConfig CRD. Again, I'm comparing to existing fields that store secret filenames, like victorOpsConfig.APIKeyFile.

However, I did add some unit tests and fix validation for these new fields.

@pull-request-size pull-request-size Bot added size/L and removed size/M labels May 25, 2026
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