Skip to content

Commit

Permalink
fix discord & msteams webhook url configuration (prometheus#3728)
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Kröger <l.kroeger01@gmail.com>
Signed-off-by: Gokhan Sari <gokhan@sari.me>
  • Loading branch information
LucaDev authored and th0th committed Mar 23, 2024
1 parent 2b66da0 commit c021f01
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,8 @@ func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {
if discord.HTTPConfig == nil {
discord.HTTPConfig = c.Global.HTTPConfig
}
if discord.WebhookURL == nil {
return fmt.Errorf("no discord webhook URL provided")
if discord.WebhookURL == nil && len(discord.WebhookURLFile) == 0 {
return fmt.Errorf("no discord webhook URL or URLFile provided")
}
}
for _, webex := range rcv.WebexConfigs {
Expand All @@ -536,8 +536,8 @@ func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error {
if msteams.HTTPConfig == nil {
msteams.HTTPConfig = c.Global.HTTPConfig
}
if msteams.WebhookURL == nil {
return fmt.Errorf("no msteams webhook URL provided")
if msteams.WebhookURL == nil && len(msteams.WebhookURLFile) == 0 {
return fmt.Errorf("no msteams webhook URL or URLFile provided")
}
}

Expand Down

0 comments on commit c021f01

Please sign in to comment.