alertmanager/api/v2/models
Max Leonard Inden 2f055d9966
api/v2: Do not populate cluster info if clustering is disabled
When users start Alertmanager with `--cluster.listen-address=`, the
cluster will not be initialized, hence api.peer will be `nil`. So far
this would result in a nil pointer dereference by the API v2 accessing
the api.peer field.

With this patch, api v2 skips populating the peers array, sets the name
to an empty string and the status to "disabled" in case `api.peer` is
nil.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2019-01-31 16:56:59 +01:00
..
alert.go api/v2: Extract shared properties of gettable and postable alert 2018-11-28 14:35:39 +01:00
alert_status.go ui: Move /status & /silences to API v2 2018-11-15 13:24:26 +01:00
alertmanager_config.go ui: Move /status & /silences to API v2 2018-11-15 13:24:26 +01:00
alertmanager_status.go ui: Move /status & /silences to API v2 2018-11-15 13:24:26 +01:00
cluster_status.go api/v2: Do not populate cluster info if clustering is disabled 2019-01-31 16:56:59 +01:00
gettable_alert.go api/v2: Extract shared properties of gettable and postable alert 2018-11-28 14:35:39 +01:00
gettable_alerts.go ui: Move /alerts to API v2 2018-11-23 12:53:48 +01:00
gettable_silence.go api/v2/openapi.yaml: Differentiate between post and get silence 2018-11-15 16:21:07 +01:00
gettable_silences.go api/v2/openapi.yaml: Differentiate between post and get silence 2018-11-15 16:21:07 +01:00
label_set.go api: Implement OpenAPI generated Alertmanager API V2 2018-09-04 13:38:34 +02:00
matcher.go ui: Move /status & /silences to API v2 2018-11-15 13:24:26 +01:00
matchers.go api: Implement OpenAPI generated Alertmanager API V2 2018-09-04 13:38:34 +02:00
peer_status.go ui: Move /status & /silences to API v2 2018-11-15 13:24:26 +01:00
postable_alert.go api/v2: Extract shared properties of gettable and postable alert 2018-11-28 14:35:39 +01:00
postable_alerts.go ui: Move /alerts to API v2 2018-11-23 12:53:48 +01:00
postable_silence.go api/v2/openapi.yaml: Differentiate between post and get silence 2018-11-15 16:21:07 +01:00
receiver.go ui: Move /status & /silences to API v2 2018-11-15 13:24:26 +01:00
silence.go api/v2/openapi.yaml: Differentiate between post and get silence 2018-11-15 16:21:07 +01:00
silence_status.go ui: Move /status & /silences to API v2 2018-11-15 13:24:26 +01:00
version_info.go ui: Move /status & /silences to API v2 2018-11-15 13:24:26 +01:00