Merge pull request #4916 from stefanberger/streamproc_env_vars

Allow passing environent variables to StreamProcessors
This commit is contained in:
Maksym Pavlenko
2021-01-11 16:34:12 -08:00
committed by GitHub
5 changed files with 9 additions and 5 deletions

View File

@@ -80,6 +80,8 @@ type StreamProcessor struct {
Path string `toml:"path"`
// Args to the binary
Args []string `toml:"args"`
// Environment variables for the binary
Env []string `toml:"env"`
}
// GetVersion returns the config file's version

View File

@@ -91,7 +91,7 @@ func New(ctx context.Context, config *srvconfig.Config) (*Server, error) {
return nil, err
}
for id, p := range config.StreamProcessors {
diff.RegisterProcessor(diff.BinaryHandler(id, p.Returns, p.Accepts, p.Path, p.Args))
diff.RegisterProcessor(diff.BinaryHandler(id, p.Returns, p.Accepts, p.Path, p.Args, p.Env))
}
serverOpts := []grpc.ServerOption{