Repository navigation
Fix: update Alertmanager secret config logic to validate Telegram bot token - #8465
Merged
simonpasquier merged 3 commits intoMar 26, 2026
Merged
Conversation
as it may be added in the global config
to scope with the lower version
to ensure the logic is correctly implemented
Contributor
Author
|
@simonpasquier Hi, could you please have a look at this PR? |
1 of 5 tasks
simonpasquier
approved these changes
Mar 26, 2026
Contributor
|
thanks! |
guoard
reviewed
Apr 10, 2026
| tc.BotTokenFile = "" | ||
| } | ||
|
|
||
| if tc.BotToken == "" && tc.BotTokenFile == "" { |
Contributor
There was a problem hiding this comment.
Could you clarify why you changed the order of the conditions and moved this after the next one?
Contributor
Author
There was a problem hiding this comment.
Nothing behind. My first intention was to remove the logic entirely before I did realize to keep this for older versions. Then, I added it back but in the different order than the original one, which I forgot to adjust it.
If this PR creates any issue, please let me know. I'm happy to fix it.
Contributor
There was a problem hiding this comment.
No, I haven’t seen any issues. I was just curious.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the logic to check bot_token and bot_token_file exists in the Alertmanager secret config.
Reason: Alertmanager >= 0.31.0 introduces the global configuration of telegram_bot_token and telegram_bot_token_file. Hence, the bot token is not required to be added in the receiver.
Type of change
What type of changes does your code introduce to the Prometheus operator? Put an
xin 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 Testing
Changelog entry