1
0
Fork 0
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:
Hélia Barroso 2025-02-18 09:39:06 +00:00 committed by Jayapriya Pai
parent 4f32e47eed
commit 69d266006d
No known key found for this signature in database
GPG key ID: 3E100BB6BD29148E
4 changed files with 23 additions and 3 deletions

View file

@ -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,

View file

@ -2,5 +2,4 @@ receivers:
- name: ""
msteamsv2_configs:
- webhook_url: http://example.com
webhook_url_file: ""
templates: []

View file

@ -0,0 +1,5 @@
receivers:
- name: ""
msteamsv2_configs:
- webhook_url_file: /var/secrets/webhook-url-file
templates: []

View file

@ -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"`