podlet icon indicating copy to clipboard operation
podlet copied to clipboard

Support IPv6 address enclosed in brackets for `ports` short syntax in compose file

Open TeamLinux01 opened this issue 1 year ago • 4 comments

I have a valid podman compose file that has these ports:

- "[fd7a:115c:a1e0:0:0:0:9f01:c080]:80:80"
- "[fd7a:115c:a1e0:0:0:0:9f01:c080]:443:443"
- "[fd7a:115c:a1e0:0:0:0:9f01:c080]:443:443/udp"

Starting the pods with podman-compose, it binds the ports to the IPv6 address without issue.

When I run podlet compose, it errors with

error parsing host ip address: invalid IP address syntax at line

the line is the first instance of the IPv6 address for ports.

Not sure if I should be using a different format for IPv6 port publishing or if it is just a bug in the parser.

TeamLinux01 avatar Aug 04 '24 19:08 TeamLinux01

In the meantime, I manually removed the IPv6 addresses, created the .container file and then added them back.

PublishPort=[fd7a:115c:a1e0:0:0:0:9f01:c080]:80:80
PublishPort=[fd7a:115c:a1e0:0:0:0:9f01:c080]:443:443
PublishPort=[fd7a:115c:a1e0:0:0:0:9f01:c080]:443:443/udp

the container starts and publishes without issues.

TeamLinux01 avatar Aug 07 '24 02:08 TeamLinux01

I dug into this a bit. It looks like the brackets around the IPv6 address are the problem. docker compose config seems to accept the address either way, but it's not specified in the Compose Specification. The only part that mentions IPv6 addresses may be enclosed in brackets is the extra_hosts short syntax description.

I'll make an issue or PR in the Compose Specification repo and also an issue for my compose_spec library.

k9withabone avatar Sep 15 '24 18:09 k9withabone

Blocked on k9withabone/compose_spec_rs#24.

k9withabone avatar Sep 15 '24 18:09 k9withabone

Created compose-spec/compose-spec#530.

k9withabone avatar Sep 15 '24 21:09 k9withabone