Allow passing environent variables to StreamProcessors
Add support for an 'env' field to the StreamProcessor configuration and append the environment variables found there to the os.Environ() array. The env field takes environment variables in the form of key=value. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
@@ -33,9 +33,10 @@ import (
|
||||
)
|
||||
|
||||
// NewBinaryProcessor returns a binary processor for use with processing content streams
|
||||
func NewBinaryProcessor(ctx context.Context, imt, rmt string, stream StreamProcessor, name string, args []string, payload *types.Any) (StreamProcessor, error) {
|
||||
func NewBinaryProcessor(ctx context.Context, imt, rmt string, stream StreamProcessor, name string, args, env []string, payload *types.Any) (StreamProcessor, error) {
|
||||
cmd := exec.CommandContext(ctx, name, args...)
|
||||
cmd.Env = os.Environ()
|
||||
cmd.Env = append(cmd.Env, env...)
|
||||
|
||||
var payloadC io.Closer
|
||||
if payload != nil {
|
||||
|
Reference in New Issue
Block a user