exec_run() should return a function to return the exit code, when stream=True
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 13d 8h
- Merged PRs (30d)
- 2
Description
Currently, container.exec_run() returns an exit code of None if socket=True or stream=True.
This is presumably because at the point that the (rc, output_generator) tuplet is returned, the exit code is not yet known.
It is, however, very annoying, as the use case of "continuously update reporting of output" is one in which knowing the return code is usually also necessary.
However, this is trivially solvable by returning a lambda function in this case:
This allows the caller to postpone evaluating rc() until after the output_generator has raised StopIteration.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the container.exec_run() entry point and review the proposed dockerdiff.txt change. Confirm how stream=True and socket=True currently expose the exit code, then make completion expose the final code after output_generator is exhausted; done means callers can retrieve that code reliably.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100