From 4e67902497fcf63b13cb5060fa2b26ecac2f0819 Mon Sep 17 00:00:00 2001 From: Mindaugas Niaura Date: Thu, 18 Jul 2024 11:50:48 +0300 Subject: [PATCH] default to alertmanager v2 api --- pkg/alert/config.go | 4 ++-- pkg/alert/config_test.go | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/alert/config.go b/pkg/alert/config.go index f509ccc993..8ad54dac89 100644 --- a/pkg/alert/config.go +++ b/pkg/alert/config.go @@ -67,7 +67,7 @@ func DefaultAlertmanagerConfig() AlertmanagerConfig { FileSDConfigs: []clientconfig.HTTPFileSDConfig{}, }, Timeout: model.Duration(time.Second * 10), - APIVersion: APIv1, + APIVersion: APIv2, } } @@ -136,7 +136,7 @@ func BuildAlertmanagerConfig(address string, timeout time.Duration) (Alertmanage StaticAddresses: []string{host}, }, Timeout: model.Duration(timeout), - APIVersion: APIv1, + APIVersion: APIv2, }, nil } diff --git a/pkg/alert/config_test.go b/pkg/alert/config_test.go index a0e259756c..5df9b88f06 100644 --- a/pkg/alert/config_test.go +++ b/pkg/alert/config_test.go @@ -58,7 +58,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { StaticAddresses: []string{"localhost:9093"}, Scheme: "http", }, - APIVersion: APIv1, + APIVersion: APIv2, }, }, { @@ -68,7 +68,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { StaticAddresses: []string{"am.example.com"}, Scheme: "https", }, - APIVersion: APIv1, + APIVersion: APIv2, }, }, { @@ -78,7 +78,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { StaticAddresses: []string{"dns+localhost:9093"}, Scheme: "http", }, - APIVersion: APIv1, + APIVersion: APIv2, }, }, { @@ -88,7 +88,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { StaticAddresses: []string{"dnssrv+localhost"}, Scheme: "http", }, - APIVersion: APIv1, + APIVersion: APIv2, }, }, { @@ -98,7 +98,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { StaticAddresses: []string{"localhost"}, Scheme: "ssh+http", }, - APIVersion: APIv1, + APIVersion: APIv2, }, }, { @@ -109,7 +109,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { Scheme: "https", PathPrefix: "/path/prefix/", }, - APIVersion: APIv1, + APIVersion: APIv2, }, }, { @@ -125,7 +125,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { StaticAddresses: []string{"localhost:9093"}, Scheme: "http", }, - APIVersion: APIv1, + APIVersion: APIv2, }, }, {