Skip to content

Commit ae7b63e

Browse files
committed
fix bug operator may crash when load plugin
Signed-off-by: wanjunlei <[email protected]>
1 parent 945792e commit ae7b63e

File tree

5 files changed

+535
-1637
lines changed

5 files changed

+535
-1637
lines changed

api/fluentbitoperator/v1alpha2/filter_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (list FilterList) Load(sl plugins.SecretLoader) (string, error) {
8282

8383
for _, item := range list.Items {
8484
merge := func(p plugins.Plugin) error {
85-
if reflect.ValueOf(p).IsNil() {
85+
if p == nil || reflect.ValueOf(p).IsNil() {
8686
return nil
8787
}
8888

api/fluentbitoperator/v1alpha2/input_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (list InputList) Load(sl plugins.SecretLoader) (string, error) {
6666

6767
for _, item := range list.Items {
6868
merge := func(p plugins.Plugin) error {
69-
if reflect.ValueOf(p).IsNil() {
69+
if p == nil || reflect.ValueOf(p).IsNil() {
7070
return nil
7171
}
7272

api/fluentbitoperator/v1alpha2/output_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (list OutputList) Load(sl plugins.SecretLoader) (string, error) {
8686

8787
for _, item := range list.Items {
8888
merge := func(p plugins.Plugin) error {
89-
if reflect.ValueOf(p).IsNil() {
89+
if p == nil || reflect.ValueOf(p).IsNil() {
9090
return nil
9191
}
9292

api/fluentbitoperator/v1alpha2/parser_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (list ParserList) Load(sl plugins.SecretLoader) (string, error) {
8080

8181
for _, item := range list.Items {
8282
merge := func(p plugins.Plugin) error {
83-
if reflect.ValueOf(p).IsNil() {
83+
if p == nil || reflect.ValueOf(p).IsNil() {
8484
return nil
8585
}
8686

0 commit comments

Comments
 (0)