Skip to content

Commit

Permalink
Merge pull request #113 from vinted/feture/set_alertmanagerV2_default
Browse files Browse the repository at this point in the history
default to alertmanager v2 api
  • Loading branch information
niaurys authored Jul 18, 2024
2 parents 681b7e1 + 4e67902 commit e0221e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkg/alert/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func DefaultAlertmanagerConfig() AlertmanagerConfig {
FileSDConfigs: []clientconfig.HTTPFileSDConfig{},
},
Timeout: model.Duration(time.Second * 10),
APIVersion: APIv1,
APIVersion: APIv2,
}
}

Expand Down Expand Up @@ -136,7 +136,7 @@ func BuildAlertmanagerConfig(address string, timeout time.Duration) (Alertmanage
StaticAddresses: []string{host},
},
Timeout: model.Duration(timeout),
APIVersion: APIv1,
APIVersion: APIv2,
}, nil
}

Expand Down
14 changes: 7 additions & 7 deletions pkg/alert/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
StaticAddresses: []string{"localhost:9093"},
Scheme: "http",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand All @@ -68,7 +68,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
StaticAddresses: []string{"am.example.com"},
Scheme: "https",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand All @@ -78,7 +78,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
StaticAddresses: []string{"dns+localhost:9093"},
Scheme: "http",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand All @@ -88,7 +88,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
StaticAddresses: []string{"dnssrv+localhost"},
Scheme: "http",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand All @@ -98,7 +98,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
StaticAddresses: []string{"localhost"},
Scheme: "ssh+http",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand All @@ -109,7 +109,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
Scheme: "https",
PathPrefix: "/path/prefix/",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand All @@ -125,7 +125,7 @@ func TestBuildAlertmanagerConfiguration(t *testing.T) {
StaticAddresses: []string{"localhost:9093"},
Scheme: "http",
},
APIVersion: APIv1,
APIVersion: APIv2,
},
},
{
Expand Down

0 comments on commit e0221e6

Please sign in to comment.