Skip to content

Add condition parameter for containerWait - #97

Open
abretschneider wants to merge 1 commit into
clue:1.xfrom
abretschneider:add-condition-parameter-for-container-wait
Open

Add condition parameter for containerWait#97
abretschneider wants to merge 1 commit into
clue:1.xfrom
abretschneider:add-condition-parameter-for-container-wait

Conversation

@abretschneider

@abretschneider abretschneider commented Jul 27, 2026

Copy link
Copy Markdown

The containerWait https://docs.docker.com/reference/api/engine/version/v1.40/#tag/Container/operation/ContainerWait API supports a condition parameter which is not pass in the Client yet.
Add it as a method parameter and pass it if set.

@abretschneider
abretschneider force-pushed the add-condition-parameter-for-container-wait branch from 00c8e31 to f7cf661 Compare July 27, 2026 15:18
@abretschneider
abretschneider force-pushed the add-condition-parameter-for-container-wait branch from f7cf661 to 480f8de Compare July 27, 2026 15:41
@clue clue added the new feature New feature or request label Aug 6, 2026
@clue clue added this to the v1.7.0 milestone Aug 6, 2026
@clue
clue requested a lite review from Copilot August 6, 2026 09:21

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.

Pull request overview

This pull request updates the Docker client wrapper to support the Docker Engine ContainerWait API’s optional condition query parameter, enabling callers to wait for specific container state transitions.

Changes:

  • Extend Client::containerWait() with an optional $condition argument and pass it as condition in the request URI when provided.
  • Add a unit test covering containerWait() with condition=next-exit.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/ClientTest.php Adds test coverage for containerWait() when passing the condition query parameter.
src/Client.php Adds optional $condition parameter to containerWait() and includes it in the URI template expansion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Client.php
* Block until container id stops, then returns the exit code
*
* @param string $container container ID
* @param string $condition Wait until a container state reaches the given condition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants