@@ -38,6 +38,7 @@ import (
3838type config struct {
3939 Indices string `json:"indices"`
4040 LogFile string `json:"logFile"`
41+ SocketPath string `json:"socketPath"`
4142 VerboseLevel int `json:"verboseLevel"`
4243 Yaml bool `json:"yaml"`
4344}
@@ -339,7 +340,7 @@ func (p *plugin) printYamlDiff(apifunc string, obj string, origValue interface{}
339340 }
340341}
341342
342- func startPlugin (wg * sync.WaitGroup , pluginIdx int ) {
343+ func startPlugin (wg * sync.WaitGroup , pluginIdx int , socketPath string ) {
343344 var (
344345 opts []stub.Option
345346 err error
@@ -353,6 +354,10 @@ func startPlugin(wg *sync.WaitGroup, pluginIdx int) {
353354 opts = append (opts , stub .WithPluginIdx (idxStr ))
354355 }
355356
357+ if socketPath != "" {
358+ opts = append (opts , stub .WithSocketPath (socketPath ))
359+ }
360+
356361 p := & plugin {}
357362 if p .mask , err = api .ParseEventMask ("all" ); err != nil {
358363 log .Fatalf ("Failed to parse events: %v" , err )
@@ -391,6 +396,7 @@ func main() {
391396 "indices 45, 50 and 80. Note that this plugin will install itself to index 0 and 99\n " +
392397 "if this parameter is not given." )
393398 flag .BoolVar (& cfg .Yaml , "yaml" , false , "Print the diff in yaml" )
399+ flag .StringVar (& cfg .SocketPath , "socket-path" , "" , "path of the NRI socket file" )
394400 flag .Parse ()
395401
396402 if cfg .LogFile != "" {
@@ -431,7 +437,7 @@ func main() {
431437
432438 wg .Add (1 )
433439
434- go startPlugin (wg , idx )
440+ go startPlugin (wg , idx , cfg . SocketPath )
435441 }
436442
437443 entry := indices [prevIndex ]
0 commit comments