Skip to content

Commit

Permalink
make lua scripts code and script not required
Browse files Browse the repository at this point in the history
Signed-off-by: Onecer <[email protected]>
  • Loading branch information
onecer committed Apr 17, 2024
1 parent 8c05b8d commit 412c85a
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 19 deletions.
6 changes: 3 additions & 3 deletions apis/fluentbit/v1alpha2/plugins/filter/lua_types.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package filter

import (
"regexp"
"strconv"
"strings"
"regexp"

"github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2/plugins"
"github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2/plugins/params"
Expand All @@ -17,12 +17,12 @@ import (
type Lua struct {
plugins.CommonParams `json:",inline"`
// Path to the Lua script that will be used.
Script v1.ConfigMapKeySelector `json:"script"`
Script v1.ConfigMapKeySelector `json:"script,omitempty"`
// Lua function name that will be triggered to do filtering.
// It's assumed that the function is declared inside the Script defined above.
Call string `json:"call"`
// Inline LUA code instead of loading from a path via script.
Code string `json:"code"`
Code string `json:"code,omitempty"`
// If these keys are matched, the fields are converted to integer.
// If more than one key, delimit by space.
// Note that starting from Fluent Bit v1.6 integer data types are preserved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,6 @@ spec:
type: array
required:
- call
- code
- script
type: object
modify:
description: Modify defines Modify Filter configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,6 @@ spec:
type: array
required:
- call
- code
- script
type: object
modify:
description: Modify defines Modify Filter configuration.
Expand Down
2 changes: 0 additions & 2 deletions config/crd/bases/fluentbit.fluent.io_clusterfilters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,6 @@ spec:
type: array
required:
- call
- code
- script
type: object
modify:
description: Modify defines Modify Filter configuration.
Expand Down
2 changes: 0 additions & 2 deletions config/crd/bases/fluentbit.fluent.io_filters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,6 @@ spec:
type: array
required:
- call
- code
- script
type: object
modify:
description: Modify defines Modify Filter configuration.
Expand Down
4 changes: 0 additions & 4 deletions manifests/setup/fluent-operator-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,6 @@ spec:
type: array
required:
- call
- code
- script
type: object
modify:
description: Modify defines Modify Filter configuration.
Expand Down Expand Up @@ -11438,8 +11436,6 @@ spec:
type: array
required:
- call
- code
- script
type: object
modify:
description: Modify defines Modify Filter configuration.
Expand Down
4 changes: 0 additions & 4 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,6 @@ spec:
type: array
required:
- call
- code
- script
type: object
modify:
description: Modify defines Modify Filter configuration.
Expand Down Expand Up @@ -11438,8 +11436,6 @@ spec:
type: array
required:
- call
- code
- script
type: object
modify:
description: Modify defines Modify Filter configuration.
Expand Down

0 comments on commit 412c85a

Please sign in to comment.