see-quick commented on code in PR #20546:
URL: https://github.com/apache/kafka/pull/20546#discussion_r2371532843
##########
tests/docker/ducker-ak:
##########
@@ -55,6 +55,9 @@ default_image_name="ducker-ak"
# The default kafka server mode.
default_kafka_mode="jvm"
+# Container runtime command (docker or podman)
+container_runtime=""
Review Comment:
I mean, the function [1] defaults to Docker, since
`detect_container_runtime` checks for it before Podman. It also respects the
`CONTAINER_RUNTIME` environment variable if set, or a previously assigned value
of `container_runtime` during the current shell execution. I think, this would
not break any environments or do you think that is there some system, which
does not have `which`?
[1] -
```bash
detect_container_runtime() {
if [[ -n "${container_runtime}" ]]; then
return # Already set
fi
# Allow override via environment variable
if [[ -n "${CONTAINER_RUNTIME}" ]]; then
container_runtime="${CONTAINER_RUNTIME}"
which "${container_runtime}" &> /dev/null || die "Specified
container runtime '${container_runtime}' not found."
return
fi
if which docker &> /dev/null; then
container_runtime="docker"
elif which podman &> /dev/null; then
container_runtime="podman"
else
die "No supported container runtime found. Please install docker or
podman, or set CONTAINER_RUNTIME environment variable."
fi
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]