woodpecker/pipeline
6543 d07c66d956
fix: docker backend should not close 'engine.Tail' result (#1616) (#1620)
Backport #1616

Close #1615

The error described in
https://github.com/woodpecker-ci/woodpecker/issues/1615 is happening
because `Tail` method of the docker backend closes the instance of
`io.ReadCloser` it returns in `defer` function. As a result anything
that try to read data returned by `Tail` method eventually will attempt
to read from closes reader and get an error:



2171212c5a/pipeline/backend/docker/docker.go (L229)

The fix is just don't close returned reader and let the consumer of
`Tail` method do it. Good thing is that `Tail` is used only in one place
and reader is correctly closed:



2171212c5a/pipeline/pipeline.go (L231-L237)

Example of `woodpecker exec` output using pipeline from
https://github.com/woodpecker-ci/woodpecker/issues/1615 with the fix:

```
woodpecker exec .woodpecker.yaml
[step1:L0:0s] + echo step1
[step1:L1:0s] step1
[step2:L0:0s] + echo step2
[step2:L1:0s] step2
```

Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Co-authored-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2023-03-14 12:22:52 +01:00
..
backend fix: docker backend should not close 'engine.Tail' result (#1616) (#1620) 2023-03-14 12:22:52 +01:00
frontend [Backport] sanitizeParamKey "-" to "_" for plugin settings (#1511) 2022-12-31 19:21:34 +02:00
interrupt Add linter misspell (#530) 2021-11-24 02:01:12 +01:00
multipart Move entirely to zerolog (#426) 2021-10-12 09:25:13 +02:00
rpc make gRPC error "to many keepalive pings" only show up in trace logs (#787) 2022-02-24 15:53:44 +01:00
samples Replace DRONE_ with CI_ variables in pipeline steps (#427) 2021-11-25 20:43:31 +01:00
schema Update json schema for cli lint to cover valid cases (#1384) 2022-11-05 00:08:56 +01:00
shared Fix multiline secrets replacer (#700) 2022-01-16 22:57:37 +01:00
error.go Add linter misspell (#530) 2021-11-24 02:01:12 +01:00
error_test.go Move cncd/pipeline/pipeline/ to pipeline/ (#347) 2021-09-24 13:18:34 +02:00
logger.go Add backend selection for agent (#463) 2021-11-26 03:34:48 +01:00
option.go Add backend selection for agent (#463) 2021-11-26 03:34:48 +01:00
option_test.go Move cncd/pipeline/pipeline/ to pipeline/ (#347) 2021-09-24 13:18:34 +02:00
parse.go Add backend selection for agent (#463) 2021-11-26 03:34:48 +01:00
parse_test.go Move cncd/pipeline/pipeline/ to pipeline/ (#347) 2021-09-24 13:18:34 +02:00
pipeline.go Add backend selection for agent (#463) 2021-11-26 03:34:48 +01:00
tracer.go Fix various typos (#416) 2021-10-08 18:35:56 +02:00