mirror of
https://github.com/containers/podman.git
synced 2025-12-02 11:08:36 +08:00
podman logs passthrough driver support --cgroups=split
When run with --cgroups=split mode (e.g. quadlet) we do not use the a separate cgroup for the container and just run in the unit cgroup. When we filter logs we thus must match the unit name. Added a small test to the quadlet test to make sure it will work. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@@ -141,7 +141,7 @@ function remove_secret() {
|
||||
cat > $quadlet_file <<EOF
|
||||
[Container]
|
||||
Image=$IMAGE
|
||||
Exec=sh -c "echo STARTED CONTAINER; echo "READY=1" | socat -u STDIN unix-sendto:\$NOTIFY_SOCKET; top"
|
||||
Exec=sh -c "echo STARTED CONTAINER; echo "READY=1" | socat -u STDIN unix-sendto:\$NOTIFY_SOCKET; sleep inf"
|
||||
Notify=yes
|
||||
EOF
|
||||
|
||||
@@ -152,6 +152,10 @@ EOF
|
||||
run journalctl "--since=$STARTED_TIME" --unit="$QUADLET_SERVICE_NAME"
|
||||
is "$output" '.*STARTED CONTAINER.*'
|
||||
|
||||
# check that we can read the logs from the container with podman logs
|
||||
run_podman logs $QUADLET_CONTAINER_NAME
|
||||
assert "$output" == "STARTED CONTAINER" "podman logs works on quadlet container"
|
||||
|
||||
run_podman container inspect --format "{{.State.Status}}" $QUADLET_CONTAINER_NAME
|
||||
is "$output" "running" "container should be started by systemd and hence be running"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user