alertmanager/test/with_api_v2
Max Leonard Inden 2223da2c30
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-28 11:19:47 +01:00
..
acceptance test/with_api_v2: add test for route prefix 2018-11-23 13:59:28 +01:00
api_v2_client api/v2: Do not populate cluster info if clustering is disabled 2019-01-28 11:19:47 +01:00
acceptance.go *: update Makefile.common with new staticcheck (#1692) 2019-01-14 15:23:41 +01:00
collector.go ui: Move /alerts to API v2 2018-11-23 12:53:48 +01:00
mock.go api/v2: Extract shared properties of gettable and postable alert 2018-11-28 14:35:39 +01:00