Skip to content

Commit

Permalink
alertmanager: Add Telegram Receiver type to AlertmanagerConfig CRD
Browse files Browse the repository at this point in the history
fix unit testing
  • Loading branch information
angelbarrera92 committed May 9, 2022
1 parent 16422a9 commit 01bf10d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/alertmanager/amcfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,7 @@ func (tc *telegramConfig) sanitize(amVersion semver.Version, logger log.Logger)
return errors.Errorf("mandatory field %q is empty", "chatID")
}

if tc.BotToken != "" {
if tc.BotToken == "" {
return fmt.Errorf("mandatory field %q is empty", "botToken")
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/alertmanager/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1506,9 +1506,9 @@ func checkTelegramConfigs(
if len(configs) == 0 {
return nil
}
if amVersion.LT(semver.MustParse("0.24.0") {
return fmt.Errorf("'telegramConfigs' is available in Alertmanager >= 0.24.0 only - current %s`, amVersion)

if amVersion.LT(semver.MustParse("0.24.0")) {
return fmt.Errorf(`telegramConfigs' is available in Alertmanager >= 0.24.0 only - current %s`, amVersion)
}

for i, config := range configs {
Expand Down

0 comments on commit 01bf10d

Please sign in to comment.