see-quick commented on code in PR #20546:
URL: https://github.com/apache/kafka/pull/20546#discussion_r2398049808
##########
tests/docker/ducker-ak:
##########
@@ -142,6 +148,29 @@ require_commands() {
done
}
+# Detect and set the container runtime (docker or podman).
+# Sets the global variable container_runtime.
+# Can be overridden by setting CONTAINER_RUNTIME environment variable.
+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
+
+ container_runtime="docker"
+ if command -v 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."
Review Comment:
Ah...true. I should also add an `elif` to check Docker.
--
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]