Repository navigation
Fix custom $stderrEvent for container attach and logs streams - #108
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Custom event names matching lifecycle events can cause argument errors or duplicate error notifications.
1 open issue
What changed in this PR
Fixes custom STDERR event forwarding for container attach and log streams, addressing #96.
Changes:
- Forwards custom events through the internal stream wrapper.
- Passes the event name from both client methods.
- Adds unit and Docker-backed functional regression tests.
| File | Description |
|---|---|
| tests/Io/ReadableUnwrapStreamTest.php | Tests custom forwarding and avoids duplicate data events. |
| tests/FunctionalClientTest.php | Checks STDERR delivery against Docker. |
| tests/ClientTest.php | Tests custom events from both client methods. |
| src/Io/ReadableUnwrapStream.php | Adds optional custom event forwarding. |
| src/Client.php | Passes STDERR event names to the wrapper. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This changeset fixes the custom
$stderrEventforcontainerAttachStream()andcontainerLogsStream(). Both methods first inspect the container to check its TTY setting and previously returned a stream that only forwardeddata,end,errorandcloseevents, so the custom STDERR event never reached the caller. The stream now forwards this event as well. This has been broken since both methods were added in #53 (2019) and #61 (2020), and the functional tests now cover both against a real Docker daemon.Builds on top of #107, #61 and #53
Resolves / closes #96