mirror of
https://github.com/prometheus/alertmanager
synced 2025-02-08 06:27:25 +00:00
cli: minor style improvements
Signed-off-by: Paul Gier <pgier@redhat.com>
This commit is contained in:
parent
3b9629e294
commit
e31cfbf365
18
cli/utils.go
18
cli/utils.go
@ -104,18 +104,14 @@ func loadAlertmanagerConfig(ctx context.Context, alertmanagerURL *url.URL, confi
|
||||
}
|
||||
return cfg, nil
|
||||
}
|
||||
if alertmanagerURL != nil {
|
||||
configStatus, err := getRemoteAlertmanagerConfigStatus(ctx, alertmanagerURL)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
conf, err := config.Load(*configStatus.Config.Original)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return conf, nil
|
||||
if alertmanagerURL == nil {
|
||||
return nil, errors.New("failed to get Alertmanager configuration")
|
||||
}
|
||||
return nil, errors.New("failed to get Alertmanager configuration")
|
||||
configStatus, err := getRemoteAlertmanagerConfigStatus(ctx, alertmanagerURL)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return config.Load(*configStatus.Config.Original)
|
||||
}
|
||||
|
||||
// convertClientToCommonLabelSet converts client.LabelSet to model.Labelset
|
||||
|
Loading…
Reference in New Issue
Block a user