@@ -18,13 +18,14 @@ import (
1818)
1919
2020const (
21- authorization = "foo:bar"
22- xLogHeader0 = "testing"
23- xLogHeaderAppID = "9780495d9db3"
24- xLogHeaderAppName = "app_name"
21+ authorization = "foo:bar"
22+ xLogHeader0 = "testing"
23+ xLogHeaderAppID = "9780495d9db3"
24+ xLogHeaderAppName = "app_name"
2525)
2626
27- var expected = fmt .Sprintf (`[Service]
27+ var (
28+ expected = fmt .Sprintf (`[Service]
2829 Daemon false
2930 Flush 1
3031 Grace 30
@@ -119,7 +120,7 @@ var expected = fmt.Sprintf(`[Service]
119120 tls.verify true
120121` , authorization , xLogHeader0 , xLogHeaderAppID , xLogHeaderAppName )
121122
122- var expectedYaml = fmt .Sprintf (`service:
123+ expectedYaml = fmt .Sprintf (`service:
123124 daemon: false
124125 flush: 1
125126 grace: 30
@@ -215,7 +216,7 @@ pipeline:
215216 topics: fluentbit-namespace
216217` , authorization , xLogHeader0 , xLogHeaderAppID , xLogHeaderAppName )
217218
218- var expectedK8s = `[Service]
219+ expectedK8s = `[Service]
219220 Daemon false
220221 Flush 1
221222 Grace 30
@@ -252,7 +253,7 @@ var expectedK8s = `[Service]
252253 Write_Operation update
253254`
254255
255- var expectedK8sYaml = `service:
256+ expectedK8sYaml = `service:
256257 daemon: false
257258 flush: 1
258259 grace: 30
@@ -289,7 +290,7 @@ pipeline:
289290 write_operation: update
290291`
291292
292- var expectedK8sYamlWithClusterFilterOutput = `service:
293+ expectedK8sYamlWithClusterFilterOutput = `service:
293294 daemon: false
294295 flush: 1
295296 grace: 30
@@ -336,7 +337,7 @@ pipeline:
336337 write_operation: update
337338`
338339
339- var expectedParsers = `[PARSER]
340+ expectedParsers = `[PARSER]
340341 Name clusterparser0
341342 Format json
342343 Time_Key time
@@ -355,7 +356,7 @@ var expectedParsers = `[PARSER]
355356 Types status:integer size:integer
356357`
357358
358- var expectedMultilineParsers = `[MULTILINE_PARSER]
359+ expectedMultilineParsers = `[MULTILINE_PARSER]
359360 Name clustermultilineparser0
360361 Type regex
361362 Parser go
@@ -374,26 +375,27 @@ var expectedMultilineParsers = `[MULTILINE_PARSER]
374375 Rule "cont" "/^\s+at.*/" "cont"
375376`
376377
377- var labels = map [string ]string {
378- "label0" : "lv0" ,
379- "label1" : "lv1" ,
380- "label3" : "lval3" ,
381- "lbl2" : "lval2" ,
382- "lbl1" : "lvl1" ,
383- }
378+ labels = map [string ]string {
379+ "label0" : "lv0" ,
380+ "label1" : "lv1" ,
381+ "label3" : "lval3" ,
382+ "lbl2" : "lval2" ,
383+ "lbl1" : "lvl1" ,
384+ }
384385
385- var cfg = ClusterFluentBitConfig {
386- Spec : FluentBitConfigSpec {
387- Service : & Service {
388- Daemon : ptrBool (false ),
389- FlushSeconds : ptrFloat64 (1 ),
390- GraceSeconds : ptrInt64 (30 ),
391- HttpServer : ptrBool (true ),
392- LogLevel : "info" ,
393- ParsersFile : "parsers.conf" ,
394- },
395- },
396- }
386+ cfg = ClusterFluentBitConfig {
387+ Spec : FluentBitConfigSpec {
388+ Service : & Service {
389+ Daemon : ptrBool (false ),
390+ FlushSeconds : ptrFloat64 (1 ),
391+ GraceSeconds : ptrInt64 (30 ),
392+ HttpServer : ptrBool (true ),
393+ LogLevel : "info" ,
394+ ParsersFile : "parsers.conf" ,
395+ },
396+ },
397+ }
398+ )
397399
398400func Test_FluentBitConfig_RenderMainConfig (t * testing.T ) {
399401 g := NewGomegaWithT (t )
0 commit comments