tests: fix _get_container_ip for docker 29.0 (#4606)

This commit is contained in:
Andreas Perhab 2025-11-15 10:18:30 +01:00 committed by GitHub
parent b410e56aa9
commit 5865f546ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -10,6 +10,8 @@ All notable changes to this project will be documented in this file. The format
- **Internal:**
- `ENABLE_QUOTAS=1` - When an alias has multiple addresses, the first local mailbox address found will be used for the Dovecot dummy account workaround ([#4581](https://github.com/docker-mailserver/docker-mailserver/pull/4581))
- **Tests:**
- Make the helper method `_get_container_ip()` compatible with Docker 29 ([#4606](https://github.com/docker-mailserver/docker-mailserver/pull/4606))
### Removed

View File

@ -364,11 +364,12 @@ function _reload_postfix() {
}
# Get the IP of the container (${1}).
# This uses the "bridge" network IPAddress and doesn't consider other docker networks.
#
# @param ${1} = container name [OPTIONAL]
function _get_container_ip() {
local TARGET_CONTAINER_NAME=$(__handle_container_name "${1:-}")
docker inspect --format '{{ .NetworkSettings.IPAddress }}' "${TARGET_CONTAINER_NAME}"
docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress }}' "${TARGET_CONTAINER_NAME}"
}
# Check if a container is running.