Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pkg/falco/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ type PluginConfigInfo struct {
InitConfig interface{}
}

//lint:ignore U1000 this receiver is invoked in a tamplete and is not actually unused
func (p *PluginConfigInfo) initConfigString() string {
func (p *PluginConfigInfo) InitConfigString() string {
if p.InitConfig == nil {
return ""
}
Expand Down Expand Up @@ -72,7 +71,7 @@ stdout_output:
plugins:
{{ range $i, $p := . }} - name: {{ $p.Name }}
library_path: {{ $p.Library }}{{ if $p.InitConfig }}
init_config: {{ call $p.initConfigString }}{{ end }}{{ if $p.OpenParams }}
init_config: {{ $p.InitConfigString }}{{ end }}{{ if $p.OpenParams }}
open_params: {{ $p.OpenParams }}{{ end }}
{{ end }}load_plugins:{{ range $i, $p := . }}
- {{ $p.Name }}
Expand Down
1 change: 1 addition & 0 deletions tests/dummy/dummy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func runFalcoWithDummy(t *testing.T, r run.Runner, opts ...falco.TestOption) *fa
&falco.PluginConfigInfo{
Name: "dummy",
Library: plugins.DummyPlugin.Name(),
InitConfig: `{"foo": "bar"}`, // add dummy init config to ensure plugins with init config work
OpenParams: `'{"start": 1, "maxEvents": 2000000000}'`,
},
)
Expand Down