From 28b5a4a2aae9b4223e40a703516fb8f5d442b2c2 Mon Sep 17 00:00:00 2001 From: Andrew Kroh Date: Wed, 25 Jan 2023 20:29:37 -0500 Subject: [PATCH] servicedeployer/compose.go - pass env vars when signalling Pass environment variables when invoking docker-compose to send a signal to a service. Fixes #1114 --- .../testrunner/runners/system/servicedeployer/compose.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/testrunner/runners/system/servicedeployer/compose.go b/internal/testrunner/runners/system/servicedeployer/compose.go index ade566b3b..b7be23cd5 100644 --- a/internal/testrunner/runners/system/servicedeployer/compose.go +++ b/internal/testrunner/runners/system/servicedeployer/compose.go @@ -135,7 +135,12 @@ func (s *dockerComposeDeployedService) Signal(signal string) error { return errors.Wrap(err, "could not create Docker Compose project for service") } - opts := compose.CommandOptions{ExtraArgs: []string{"-s", signal}} + opts := compose.CommandOptions{ + Env: append( + []string{fmt.Sprintf("%s=%s", serviceLogsDirEnv, s.ctxt.Logs.Folder.Local)}, + s.sv.Env...), + ExtraArgs: []string{"-s", signal}, + } if s.ctxt.Name != "" { opts.Services = append(opts.Services, s.ctxt.Name) }