diff --git a/.changelog/17199.txt b/.changelog/17199.txt new file mode 100644 index 000000000..26998fc13 --- /dev/null +++ b/.changelog/17199.txt @@ -0,0 +1,3 @@ +```release-note:bug +logs: Fixed a bug where disabling log collection would prevent Windows tasks from starting +``` diff --git a/drivers/shared/executor/executor.go b/drivers/shared/executor/executor.go index 2d45500b2..d3da4c061 100644 --- a/drivers/shared/executor/executor.go +++ b/drivers/shared/executor/executor.go @@ -181,7 +181,7 @@ func (nopCloser) Close() error { return nil } // Stdout returns a writer for the configured file descriptor func (c *ExecCommand) Stdout() (io.WriteCloser, error) { if c.stdout == nil { - if c.StdoutPath != "" { + if c.StdoutPath != "" && c.StdoutPath != os.DevNull { f, err := fifo.OpenWriter(c.StdoutPath) if err != nil { return nil, fmt.Errorf("failed to create stdout: %v", err) @@ -197,7 +197,7 @@ func (c *ExecCommand) Stdout() (io.WriteCloser, error) { // Stderr returns a writer for the configured file descriptor func (c *ExecCommand) Stderr() (io.WriteCloser, error) { if c.stderr == nil { - if c.StderrPath != "" { + if c.StderrPath != "" && c.StderrPath != os.DevNull { f, err := fifo.OpenWriter(c.StderrPath) if err != nil { return nil, fmt.Errorf("failed to create stderr: %v", err)