cli: minor style improvements

Signed-off-by: Paul Gier <pgier@redhat.com>
This commit is contained in:
Paul Gier 2019-04-01 10:50:38 -05:00
parent 3b9629e294
commit e31cfbf365

View File

@ -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