Kube Play: use passthrough as the default log-driver if service-container is set

Reasoning
---------
When the log-driver is passthrough, the journal socket is passed to the containers as-is which has two advantages:
1. journald can see who the actual sender of the log event is,
    rather than thinking everything comes from the conmon process
2. conmon will not have to copy all the log data

Code Changes
------------
If log-driver was not set by the user and service-container is set use
passthrough as the default log-driver

Update the system tests
- explicitly set logdriver in sdnotify and play tests
- podman-kube template test:  Verify the default log driver for service-container

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
This commit is contained in:
Ygal Blum
2022-12-19 17:05:12 +02:00
parent ecbb52cb47
commit 68fbebfacc
4 changed files with 19 additions and 4 deletions

View File

@ -225,7 +225,7 @@ EOF
wait_for_file $_SOCAT_LOG
# Will run until all containers have stopped.
run_podman play kube --service-container=true $yaml_source
run_podman play kube --service-container=true --log-driver journald $yaml_source
run_podman container wait $service_container test_pod-test
# Make sure the containers have the correct policy.
@ -302,7 +302,7 @@ EOF
# Run `play kube` in the background as it will wait for all containers to
# send the READY=1 message.
timeout --foreground -v --kill=10 60 \
$PODMAN play kube --service-container=true $yaml_source &>/dev/null &
$PODMAN play kube --service-container=true --log-driver journald $yaml_source &>/dev/null &
# Wait for both containers to be running
for i in $(seq 1 20); do