Use x- prefix for x-podman.mac_address

Docker compose documents x- prefix as standard vendor prefix.

https://github.com/compose-spec/compose-spec/pull/18

Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
This commit is contained in:
Povilas Kanapickas
2024-04-17 20:15:26 +03:00
parent 1da2f85a90
commit 131010bc9d
4 changed files with 11 additions and 11 deletions

View File

@ -888,7 +888,7 @@ def get_net_args(compose, cnt):
# specified on the network level as well
if mac_address is not None:
for net_config_ in multiple_nets.values():
network_mac = net_config_.get("podman.mac_address", None)
network_mac = net_config_.get("x-podman.mac_address", None)
if network_mac is not None:
raise RuntimeError(
f"conflicting mac addresses {mac_address} and {network_mac}:"
@ -906,7 +906,7 @@ def get_net_args(compose, cnt):
ipv4 = net_config_.get("ipv4_address", None)
ipv6 = net_config_.get("ipv6_address", None)
# custom extension; not supported by docker-compose v3
mac = net_config_.get("podman.mac_address", None)
mac = net_config_.get("x-podman.mac_address", None)
# if a mac_address was specified on the container level, apply it to the first network
# This works for Python > 3.6, because dict insert ordering is preserved, so we are