[rescontainerocibase] Stream stdout and stderr logs#1068
Merged
Conversation
cgalibern
requested changes
Jul 17, 2026
cgalibern
left a comment
Contributor
There was a problem hiding this comment.
Hello Hugo, many thanks for this pr 👍
Can you just test the error first in the read stream function ?
| return | ||
| } | ||
| } | ||
| if err != nil { |
Contributor
There was a problem hiding this comment.
May you test first the err value (move this block to the line 407)
Contributor
Author
There was a problem hiding this comment.
Done, thanks for the review
cgalibern
approved these changes
Jul 17, 2026
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.
Summary
Fix container log streaming so OpenSVC returns logs written to both stdout and
stderr by Docker and Podman workloads.
Before this change, the container executor only read stderr and explicitly
discarded stdout. Workloads such as Redis, which write their logs to stdout,
therefore returned an empty result through
om ... container logs.Root cause
The container executor only opened the command stderr pipe:
The command stdout was discarded:
Container runtimes preserve the stdout and stderr streams of the container
process. The
docker logscommand writes them to the corresponding stdout andstderr streams of the Docker CLI.
Consequently:
Fix
The executor now:
The existing public interface remains unchanged:
Test environment
The fix was reproduced and validated on an OpenSVC single-node lab.
Service status:
The Docker container is running with the
json-filelog driver:Reproduction before the fix
Docker contains Redis logs:
However, OpenSVC returns no output:
This confirms that the logs exist in Docker but are lost in the OpenSVC
container executor.
Validation after the fix
The patched
ombinary was built without replacing the installed binary:$ go build -o /tmp/om3-fix ./cmd/omThe same command now returns the Redis stdout logs:
The result now matches
docker logs.Automated regression test
A regression test starts a helper process that writes distinct messages to
stdout and stderr:
The test consumes the returned log channel and verifies that both messages are
present.
This test would fail with the previous implementation because the stdout marker
was discarded.
Validation commands
Package tests:
Race detector:
Static analysis:
$ go vet ./drivers/rescontainerocibaseNo race was detected.
Screenshots
Before the fix
After the fix