Skip to content

Commit 9906489

Browse files
committed
Renamed Logical_Op to LogicalOp
Signed-off-by: joseacl <[email protected]>
1 parent a9c6856 commit 9906489

File tree

11 files changed

+32
-32
lines changed

11 files changed

+32
-32
lines changed

charts/logging-operator/charts/logging-operator-crds/templates/logging.banzaicloud.io_fluentbitagents.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ spec:
12821282
items:
12831283
type: string
12841284
type: array
1285-
Logical_Op:
1285+
LogicalOp:
12861286
default: legacy
12871287
enum:
12881288
- legacy

charts/logging-operator/charts/logging-operator-crds/templates/logging.banzaicloud.io_loggings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2138,7 +2138,7 @@ spec:
21382138
items:
21392139
type: string
21402140
type: array
2141-
Logical_Op:
2141+
LogicalOp:
21422142
default: legacy
21432143
enum:
21442144
- legacy

charts/logging-operator/crds/logging.banzaicloud.io_fluentbitagents.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ spec:
12791279
items:
12801280
type: string
12811281
type: array
1282-
Logical_Op:
1282+
LogicalOp:
12831283
default: legacy
12841284
enum:
12851285
- legacy

charts/logging-operator/crds/logging.banzaicloud.io_loggings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,7 @@ spec:
21352135
items:
21362136
type: string
21372137
type: array
2138-
Logical_Op:
2138+
LogicalOp:
21392139
default: legacy
21402140
enum:
21412141
- legacy

config/crd/bases/logging.banzaicloud.io_fluentbitagents.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ spec:
12791279
items:
12801280
type: string
12811281
type: array
1282-
Logical_Op:
1282+
LogicalOp:
12831283
default: legacy
12841284
enum:
12851285
- legacy

config/crd/bases/logging.banzaicloud.io_loggings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,7 @@ spec:
21352135
items:
21362136
type: string
21372137
type: array
2138-
Logical_Op:
2138+
LogicalOp:
21392139
default: legacy
21402140
enum:
21412141
- legacy

docs/configuration/crds/v1beta1/fluentbit_types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ FilterGrep The Grep Filter plugin
860860
Exclude records where the content of KEY matches the regular expression.
861861

862862

863-
### Logical_Op (string, optional) {#filtergrep-logical_op}
863+
### LogicalOp (string, optional) {#filtergrep-logicalop}
864864

865865
Specify a logical operator: AND, OR or legacy (default). In legacy mode the behavior is either AND or OR depending on whether the grep is including (uses AND) or excluding (uses OR). Available from 2.1 or higher. Default: "legacy"
866866

pkg/resources/fluentbit/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ var fluentBitConfigTemplate = `
7777
Name grep
7878
Match {{ .FluentdFilterGrep.Match }}
7979
80-
{{- if .FluentdFilterGrep.Logical_Op }}
81-
Logical_Op {{ .FluentdFilterGrep.Logical_Op }}
80+
{{- if .FluentdFilterGrep.LogicalOp }}
81+
Logical_Op {{ .FluentdFilterGrep.LogicalOp }}
8282
{{- end }}
8383
8484
{{- range $value := .FluentdFilterGrep.Regex }}

pkg/resources/fluentbit/configsecret.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ type fluentBitConfig struct {
8787
}
8888

8989
type FluentdFilterGrep struct {
90-
Match string
91-
Regex []string
92-
Exclude []string
93-
Logical_Op string
90+
Match string
91+
Regex []string
92+
Exclude []string
93+
LogicalOp string
9494
}
9595

9696
type fluentForwardOutputConfig struct {
@@ -474,15 +474,15 @@ func (r *Reconciler) configSecret() (runtime.Object, reconciler.DesiredState, er
474474
}
475475

476476
func toFluentdFilterGrep(filterGrep *v1beta1.FilterGrep) (*FluentdFilterGrep, error) {
477-
if filterGrep.Logical_Op != "legacy" && len(filterGrep.Regex) > 0 && len(filterGrep.Exclude) > 0 {
478-
return nil, errors.New("failed to parse grep filter for fluentbit, Logical_Op is set, it's not possible to set both Regex and Exclude")
477+
if filterGrep.LogicalOp != "legacy" && len(filterGrep.Regex) > 0 && len(filterGrep.Exclude) > 0 {
478+
return nil, errors.New("failed to parse grep filter for fluentbit, LogicalOp is set, it's not possible to set both Regex and Exclude")
479479
}
480480

481481
fluentdFilterGrep := &FluentdFilterGrep{
482-
Match: filterGrep.Match,
483-
Regex: filterGrep.Regex,
484-
Exclude: filterGrep.Exclude,
485-
Logical_Op: filterGrep.Logical_Op,
482+
Match: filterGrep.Match,
483+
Regex: filterGrep.Regex,
484+
Exclude: filterGrep.Exclude,
485+
LogicalOp: filterGrep.LogicalOp,
486486
}
487487

488488
return fluentdFilterGrep, nil

pkg/resources/fluentbit/configsecret_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,32 @@ import (
2323

2424
func TestInvalidFilterGrepConfig(t *testing.T) {
2525
invalidFilterGrep := &v1beta1.FilterGrep{
26-
Match: "*",
27-
Regex: []string{"regex", "reg2"},
28-
Exclude: []string{"exclude"},
29-
Logical_Op: "AND",
26+
Match: "*",
27+
Regex: []string{"regex", "reg2"},
28+
Exclude: []string{"exclude"},
29+
LogicalOp: "AND",
3030
}
3131

3232
_, err := toFluentdFilterGrep(invalidFilterGrep)
3333

34-
assert.EqualError(t, err, "failed to parse grep filter for fluentbit, Logical_Op is set, it's not possible to set both Regex and Exclude")
34+
assert.EqualError(t, err, "failed to parse grep filter for fluentbit, LogicalOp is set, it's not possible to set both Regex and Exclude")
3535
}
3636

3737
func TestValidFilterGrepConfig(t *testing.T) {
3838
filterGrep := &v1beta1.FilterGrep{
39-
Match: "*",
40-
Regex: []string{"regex1", "regex2"},
41-
Logical_Op: "AND",
39+
Match: "*",
40+
Regex: []string{"regex1", "regex2"},
41+
LogicalOp: "AND",
4242
}
4343

4444
expectedFluentFilterGrep := &FluentdFilterGrep{
45-
Match: "*",
46-
Regex: []string{"regex1", "regex2"},
47-
Logical_Op: "AND",
45+
Match: "*",
46+
Regex: []string{"regex1", "regex2"},
47+
LogicalOp: "AND",
4848
}
4949

5050
parserFluentdFilterGrep, err := toFluentdFilterGrep(filterGrep)
5151

5252
assert.NoError(t, err)
53-
assert.EqualValues(t, parserFluentdfilterGrep, expectedFluentFilterGrep)
53+
assert.EqualValues(t, parserFluentdFilterGrep, expectedFluentFilterGrep)
5454
}

0 commit comments

Comments
 (0)