MCPcopy Index your code
hub / github.com/cortexproject/cortex / validateAlertmanagerConfig

Function validateAlertmanagerConfig

pkg/configs/api/api.go:229–245  ·  view source on GitHub ↗
(cfg string, noCfg NotificationsConfig)

Source from the content-addressed store, hash-verified

227}
228
229func validateAlertmanagerConfig(cfg string, noCfg NotificationsConfig) error {
230 amCfg, err := amconfig.Load(cfg)
231 if err != nil {
232 return err
233 }
234
235 for _, recv := range amCfg.Receivers {
236 if noCfg.DisableEmail && len(recv.EmailConfigs) > 0 {
237 return ErrEmailNotificationsAreDisabled
238 }
239 if noCfg.DisableWebHook && len(recv.WebhookConfigs) > 0 {
240 return ErrWebhookNotificationsAreDisabled
241 }
242 }
243
244 return nil
245}
246
247func validateRulesFiles(c userconfig.Config, nameValidationScheme model.ValidationScheme) error {
248 if nameValidationScheme == model.UnsetValidation {

Callers 2

setConfigMethod · 0.70

Calls 1

LoadMethod · 0.80

Tested by

no test coverage detected