Skip to content

Fix networkConnect() and networkDisconnect() to send valid options - #102

Merged
clue merged 2 commits into
clue:1.xfrom
clue-labs:network-options
Oct 18, 2026
Merged

clue merged 2 commits into
clue:1.xfrom
clue-labs:network-options

Conversation

@clue

@clue clue commented Oct 18, 2026

Copy link
Copy Markdown
Owner

This changeset fixes networkConnect() and networkDisconnect() to send valid options. Passing $endpointConfig or $force previously made Docker reject the request with 400 Bad Request, because the endpoint config was sent as a JSON string instead of an object and Force was sent as 1 instead 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

@clue clue added the bug Something isn't working label Oct 18, 2026
@clue clue added this to the v1.7.0 milestone Oct 18, 2026
@clue
clue requested a balanced review from Copilot October 18, 2026 00:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@clue
clue merged commit 42b1d1e into clue:1.x Oct 18, 2026
15 checks passed
@clue
clue deleted the network-options branch October 18, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants