@@ -418,7 +418,7 @@ func TestClusterOutputList_Load_As_Yaml(t *testing.T) {
418418func TestLokiOutputWithStructuredMetadata_Load (t * testing.T ) {
419419 g := NewGomegaWithT (t )
420420 sl := plugins .NewSecretLoader (nil , "testnamespace" )
421-
421+
422422 lokiOutput := ClusterOutput {
423423 TypeMeta : metav1.TypeMeta {
424424 APIVersion : "fluentbit.fluent.io/v1alpha2" ,
@@ -437,9 +437,9 @@ func TestLokiOutputWithStructuredMetadata_Load(t *testing.T) {
437437 "environment=production" ,
438438 },
439439 StructuredMetadata : map [string ]string {
440- "pod" : "${record['kubernetes']['pod_name']}" ,
440+ "pod" : "${record['kubernetes']['pod_name']}" ,
441441 "container" : "${record['kubernetes']['container_name']}" ,
442- "trace_id" : "${record['trace_id']}" ,
442+ "trace_id" : "${record['trace_id']}" ,
443443 },
444444 StructuredMetadataKeys : []string {
445445 "level" ,
@@ -448,11 +448,11 @@ func TestLokiOutputWithStructuredMetadata_Load(t *testing.T) {
448448 },
449449 },
450450 }
451-
451+
452452 outputs := ClusterOutputList {
453453 Items : []ClusterOutput {lokiOutput },
454454 }
455-
455+
456456 expected := `[Output]
457457 Name loki
458458 Match kube.*
@@ -462,7 +462,7 @@ func TestLokiOutputWithStructuredMetadata_Load(t *testing.T) {
462462 structured_metadata container=${record['kubernetes']['container_name']},pod=${record['kubernetes']['pod_name']},trace_id=${record['trace_id']}
463463 structured_metadata_keys level,caller
464464`
465-
465+
466466 result , err := outputs .Load (sl )
467467 g .Expect (err ).NotTo (HaveOccurred ())
468468 g .Expect (result ).To (Equal (expected ))
@@ -471,7 +471,7 @@ func TestLokiOutputWithStructuredMetadata_Load(t *testing.T) {
471471func TestLokiOutputWithStructuredMetadata_LoadAsYaml (t * testing.T ) {
472472 g := NewGomegaWithT (t )
473473 sl := plugins .NewSecretLoader (nil , "testnamespace" )
474-
474+
475475 lokiOutput := ClusterOutput {
476476 TypeMeta : metav1.TypeMeta {
477477 APIVersion : "fluentbit.fluent.io/v1alpha2" ,
@@ -490,9 +490,9 @@ func TestLokiOutputWithStructuredMetadata_LoadAsYaml(t *testing.T) {
490490 "environment=production" ,
491491 },
492492 StructuredMetadata : map [string ]string {
493- "pod" : "${record['kubernetes']['pod_name']}" ,
493+ "pod" : "${record['kubernetes']['pod_name']}" ,
494494 "container" : "${record['kubernetes']['container_name']}" ,
495- "trace_id" : "${record['trace_id']}" ,
495+ "trace_id" : "${record['trace_id']}" ,
496496 },
497497 StructuredMetadataKeys : []string {
498498 "level" ,
@@ -501,11 +501,11 @@ func TestLokiOutputWithStructuredMetadata_LoadAsYaml(t *testing.T) {
501501 },
502502 },
503503 }
504-
504+
505505 outputs := ClusterOutputList {
506506 Items : []ClusterOutput {lokiOutput },
507507 }
508-
508+
509509 expected := `outputs:
510510 - name: loki
511511 match: "kube.*"
@@ -515,7 +515,7 @@ func TestLokiOutputWithStructuredMetadata_LoadAsYaml(t *testing.T) {
515515 structured_metadata: container=${record['kubernetes']['container_name']},pod=${record['kubernetes']['pod_name']},trace_id=${record['trace_id']}
516516 structured_metadata_keys: level,caller
517517`
518-
518+
519519 result , err := outputs .LoadAsYaml (sl , 0 )
520520 g .Expect (err ).NotTo (HaveOccurred ())
521521 g .Expect (result ).To (Equal (expected ))
0 commit comments