Skip to content

fix: omit empty text field in Mattermost notifications#4985

Open
slashpai wants to merge 1 commit intoprometheus:mainfrom
slashpai:mattermost-text-fix
Open

fix: omit empty text field in Mattermost notifications#4985
slashpai wants to merge 1 commit intoprometheus:mainfrom
slashpai:mattermost-text-fix

Conversation

@slashpai
Copy link
Contributor

@slashpai slashpai commented Feb 9, 2026

Add omitempty tag to Text field to prevent sending empty text values to Mattermost, which causes 400 errors. Per the Mattermost API spec, text is only required if attachments are not set.

Related to prometheus-operator/prometheus-operator#8363

Add omitempty tag to Text field to prevent sending empty text values
to Mattermost, which causes 400 errors. Per the Mattermost API spec,
text is only required if attachments are not set.

Related to prometheus-operator/prometheus-operator#8363

Signed-off-by: Jayapriya Pai <janantha@redhat.com>
@TheMeier
Copy link
Contributor

TheMeier commented Feb 9, 2026

LGTM. Although with the default template, the text field is never empty. So one could argue (which I am not) it is working as designed and users must ensure that custom templates in mattermost_config.text must not produce empty strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants