@@ -78,7 +78,7 @@ receivers:
7878 customfield_10003: [{"value": "red" }, {"value": "blue" }, {"value": "green" }]
7979
8080# File containing template definitions. Required.
81- template: jiralert.tmpl
81+ template: [" jiralert.tmpl"]
8282`
8383
8484// Generic test that loads the testConf with no errors.
@@ -144,7 +144,7 @@ type receiverTestConfig struct {
144144type testConfig struct {
145145 Defaults * receiverTestConfig `yaml:"defaults,omitempty"`
146146 Receivers []* receiverTestConfig `yaml:"receivers,omitempty"`
147- Template string `yaml:"template,omitempty"`
147+ Template [] string `yaml:"template,omitempty"`
148148}
149149
150150// Required Config keys tests.
@@ -155,7 +155,7 @@ func TestMissingConfigKeys(t *testing.T) {
155155 var config testConfig
156156
157157 // No receivers.
158- config = testConfig {Defaults : defaultsConfig , Receivers : []* receiverTestConfig {}, Template : "jiralert.tmpl" }
158+ config = testConfig {Defaults : defaultsConfig , Receivers : []* receiverTestConfig {}, Template : [] string { "jiralert.tmpl" } }
159159 configErrorTestRunner (t , config , "no receivers defined" )
160160
161161 // No template.
@@ -188,7 +188,7 @@ func TestRequiredReceiverConfigKeys(t *testing.T) {
188188 config := testConfig {
189189 Defaults : defaultsConfig ,
190190 Receivers : []* receiverTestConfig {receiverConfig },
191- Template : "jiratemplate .tmpl" ,
191+ Template : [] string { "jiralert .tmpl"} ,
192192 }
193193 configErrorTestRunner (t , config , test .errorMessage )
194194 }
@@ -237,7 +237,7 @@ func TestAuthKeysErrors(t *testing.T) {
237237 config := testConfig {
238238 Defaults : defaultsConfig ,
239239 Receivers : []* receiverTestConfig {minimalReceiverTestConfig },
240- Template : "jiralert.tmpl" ,
240+ Template : [] string { "jiralert.tmpl" } ,
241241 }
242242
243243 configErrorTestRunner (t , config , test .errorMessage )
@@ -294,7 +294,7 @@ func TestAuthKeysOverrides(t *testing.T) {
294294 config := testConfig {
295295 Defaults : defaultsConfig ,
296296 Receivers : []* receiverTestConfig {receiverConfig },
297- Template : "jiralert.tmpl" ,
297+ Template : [] string { "jiralert.tmpl" } ,
298298 }
299299
300300 yamlConfig , err := yaml .Marshal (& config )
@@ -353,7 +353,7 @@ func TestReceiverOverrides(t *testing.T) {
353353 config := testConfig {
354354 Defaults : defaultsConfig ,
355355 Receivers : []* receiverTestConfig {receiverConfig },
356- Template : "jiralert.tmpl" ,
356+ Template : [] string { "jiralert.tmpl" } ,
357357 }
358358
359359 yamlConfig , err := yaml .Marshal (& config )
@@ -455,7 +455,7 @@ func TestAutoResolveConfigReceiver(t *testing.T) {
455455 config := testConfig {
456456 Defaults : defaultsConfig ,
457457 Receivers : []* receiverTestConfig {minimalReceiverTestConfig },
458- Template : "jiralert.tmpl" ,
458+ Template : [] string { "jiralert.tmpl" } ,
459459 }
460460
461461 configErrorTestRunner (t , config , "bad config in receiver \" test\" , 'auto_resolve' was defined with empty 'state' field" )
@@ -473,7 +473,7 @@ func TestAutoResolveConfigDefault(t *testing.T) {
473473 config := testConfig {
474474 Defaults : defaultsConfig ,
475475 Receivers : []* receiverTestConfig {minimalReceiverTestConfig },
476- Template : "jiralert.tmpl" ,
476+ Template : [] string { "jiralert.tmpl" } ,
477477 }
478478
479479 configErrorTestRunner (t , config , "bad config in defaults section: state cannot be empty" )
@@ -503,7 +503,7 @@ func TestStaticLabelsConfigMerge(t *testing.T) {
503503 config := testConfig {
504504 Defaults : defaultsConfig ,
505505 Receivers : []* receiverTestConfig {receiverConfig },
506- Template : "jiralert.tmpl" ,
506+ Template : [] string { "jiralert.tmpl" } ,
507507 }
508508
509509 yamlConfig , err := yaml .Marshal (& config )
0 commit comments