Skip to content

Commit 2d952ec

Browse files
Pass debug flag to detached process restart command (#2992)
When running a workload in detached mode with debug enabled, the debug flag was not being passed to the spawned restart command. This meant debug logging was lost after the handoff to the detached process. Signed-off-by: carlos <[email protected]> Co-authored-by: Eleftheria Stein-Kousathana <[email protected]>
1 parent 9248f70 commit 2d952ec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/workloads/manager.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,10 @@ func (d *DefaultManager) RunWorkloadDetached(ctx context.Context, runConfig *run
541541
// The config has already been saved to disk, so restart can load it
542542
detachedArgs := []string{"restart", runConfig.BaseName, "--foreground"}
543543

544+
if runConfig.Debug {
545+
detachedArgs = append(detachedArgs, "--debug")
546+
}
547+
544548
// Create a new command
545549
// #nosec G204 - This is safe as execPath is the path to the current binary
546550
detachedCmd := exec.Command(execPath, detachedArgs...)

0 commit comments

Comments
 (0)