From f0f6a5e8b0903c481ab7f6656e31124382135c57 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Tue, 21 Jan 2020 15:03:00 +0100 Subject: [PATCH] pkg/alert: fix configuration from "legacy" flags Signed-off-by: Simon Pasquier --- pkg/alert/config.go | 3 ++- pkg/alert/config_test.go | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/alert/config.go b/pkg/alert/config.go index e8398b4abb..6e402091d4 100644 --- a/pkg/alert/config.go +++ b/pkg/alert/config.go @@ -123,6 +123,7 @@ func BuildAlertmanagerConfig(address string, timeout time.Duration) (Alertmanage Scheme: scheme, StaticAddresses: []string{host}, }, - Timeout: model.Duration(timeout), + Timeout: model.Duration(timeout), + APIVersion: APIv1, }, nil } diff --git a/pkg/alert/config_test.go b/pkg/alert/config_test.go index 9dd7ddab19..ea7c3de773 100644 --- a/pkg/alert/config_test.go +++ b/pkg/alert/config_test.go @@ -55,6 +55,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { StaticAddresses: []string{"localhost:9093"}, Scheme: "http", }, + APIVersion: APIv1, }, }, { @@ -64,6 +65,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { StaticAddresses: []string{"am.example.com"}, Scheme: "https", }, + APIVersion: APIv1, }, }, { @@ -73,6 +75,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { StaticAddresses: []string{"dns+localhost:9093"}, Scheme: "http", }, + APIVersion: APIv1, }, }, { @@ -82,6 +85,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { StaticAddresses: []string{"dnssrv+localhost"}, Scheme: "http", }, + APIVersion: APIv1, }, }, { @@ -91,6 +95,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { StaticAddresses: []string{"localhost"}, Scheme: "ssh+http", }, + APIVersion: APIv1, }, }, { @@ -101,6 +106,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { Scheme: "https", PathPrefix: "/path/prefix/", }, + APIVersion: APIv1, }, }, { @@ -116,6 +122,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) { StaticAddresses: []string{"localhost:9093"}, Scheme: "http", }, + APIVersion: APIv1, }, }, {