mirror of
https://github.com/prometheus-operator/prometheus-operator.git
synced 2025-04-15 08:46:44 +00:00
fix - MSTeamsV2 config
Signed-off-by: Hélia Barroso <helia_barroso@hotmail.com>
This commit is contained in:
parent
4f32e47eed
commit
69d266006d
4 changed files with 23 additions and 3 deletions
|
@ -2843,6 +2843,22 @@ func TestSanitizeConfig(t *testing.T) {
|
|||
},
|
||||
expectErr: true,
|
||||
},
|
||||
{
|
||||
name: "msteamsv2_config with webhook url file set",
|
||||
againstVersion: versionMSteamsV2Allowed,
|
||||
in: &alertmanagerConfig{
|
||||
Receivers: []*receiver{
|
||||
{
|
||||
MSTeamsV2Configs: []*msTeamsV2Config{
|
||||
{
|
||||
WebhookURLFile: "/var/secrets/webhook-url-file",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
golden: "msteamsv2_config_with_webhook_config_file_set.golden",
|
||||
},
|
||||
{
|
||||
name: "webex_config returns error for missing mandatory field",
|
||||
againstVersion: versionWebexAllowed,
|
||||
|
|
1
pkg/alertmanager/testdata/msteamsv2_config_for_supported_versions.golden
generated
vendored
1
pkg/alertmanager/testdata/msteamsv2_config_for_supported_versions.golden
generated
vendored
|
@ -2,5 +2,4 @@ receivers:
|
|||
- name: ""
|
||||
msteamsv2_configs:
|
||||
- webhook_url: http://example.com
|
||||
webhook_url_file: ""
|
||||
templates: []
|
||||
|
|
5
pkg/alertmanager/testdata/msteamsv2_config_with_webhook_config_file_set.golden
generated
vendored
Normal file
5
pkg/alertmanager/testdata/msteamsv2_config_with_webhook_config_file_set.golden
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
receivers:
|
||||
- name: ""
|
||||
msteamsv2_configs:
|
||||
- webhook_url_file: /var/secrets/webhook-url-file
|
||||
templates: []
|
|
@ -431,8 +431,8 @@ type msTeamsConfig struct {
|
|||
|
||||
type msTeamsV2Config struct {
|
||||
SendResolved *bool `yaml:"send_resolved,omitempty"`
|
||||
WebhookURL string `yaml:"webhook_url"`
|
||||
WebhookURLFile string `yaml:"webhook_url_file"`
|
||||
WebhookURL string `yaml:"webhook_url,omitempty"`
|
||||
WebhookURLFile string `yaml:"webhook_url_file,omitempty"`
|
||||
Title string `yaml:"title,omitempty"`
|
||||
Text string `yaml:"text,omitempty"`
|
||||
HTTPConfig *httpClientConfig `yaml:"http_config,omitempty"`
|
||||
|
|
Loading…
Add table
Reference in a new issue