Repository navigation
Fix networkConnect() and networkDisconnect() to send valid options - #102
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused fixes have targeted regression coverage and no unresolved findings; tests were not executed.
No open issues 🎉
What changed in this PR
Fixes network option serialization so Docker receives endpoint configuration as an object and Force as a boolean.
Changes:
- Removes double encoding of endpoint configuration.
- Sends a boolean for forced disconnection.
- Adds unit regression coverage and exercises both options in functional tests.
| File | Description |
|---|---|
| tests/FunctionalClientTest.php | Exercises network aliases and forced disconnection. |
| tests/ClientTest.php | Verifies serialized option values. |
| src/Client.php | Corrects network request serialization. |
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
networkConnect()andnetworkDisconnect()to send valid options. Passing$endpointConfigor$forcepreviously made Docker reject the request with400 Bad Request, because the endpoint config was sent as a JSON string instead of an object andForcewas sent as1instead of a boolean. Both have been broken since they were added in #57 (2020), so this is the first release where either option works. The functional tests now cover both options against a real Docker daemon.Builds on top of #57