From ebee9bf8ef5a98ff9607de3089fb7a264af3e43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Z=C3=A1vora?= Date: Mon, 10 May 2021 12:35:28 +0200 Subject: [PATCH] fix(teams): make ChannelURL naming consistent (#2545) * chore: ignore /vendor directory * fix(teams): rename channel_url to channel-url to match config --- .gitignore | 3 +++ pipeline/alert.go | 2 +- server/server_test.go | 2 +- services/teams/service.go | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9a8c6ba7c..7a4f0baad 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ kapacitor*.zip /kapacitord /tickfmt /tickdoc + +# Ignore go vendor directory +/vendor diff --git a/pipeline/alert.go b/pipeline/alert.go index fc51cd0c3..55711ec36 100644 --- a/pipeline/alert.go +++ b/pipeline/alert.go @@ -2248,7 +2248,7 @@ type TeamsHandler struct { // Teams channel webhook URL to post messages. // If empty uses the URL from the configuration. - ChannelURL string `json:"channel_url"` + ChannelURL string `json:"channel-url"` } // Send the alert to ServiceNow. diff --git a/server/server_test.go b/server/server_test.go index d31da7e36..b10eb430f 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -9400,7 +9400,7 @@ func TestServer_ListServiceTests(t *testing.T) { Link: client.Link{Relation: client.Self, Href: "/kapacitor/v1/service-tests/teams"}, Name: "teams", Options: client.ServiceTestOptions{ - "channel_url": "", + "channel-url": "", "alert_topic": "test kapacitor alert topic", "alert_id": "foo/bar/bat", "message": "test teams message", diff --git a/services/teams/service.go b/services/teams/service.go index eac085341..d766b9507 100644 --- a/services/teams/service.go +++ b/services/teams/service.go @@ -70,7 +70,7 @@ func (s *Service) StateChangesOnly() bool { } type testOptions struct { - ChannelURL string `json:"channel_url"` + ChannelURL string `json:"channel-url"` AlertTopic string `json:"alert_topic"` AlertID string `json:"alert_id"` Message string `json:"message"`