This is a follow up to this question. I figured out a solution, but this would have been MUCH easier to debug if the language didn't violate my expectation. So now I'm wondering why it did.
Give this setup command
$ podman run -d -p 1234:1234 --name evanrox alpine:3 sleep 360
The following will stringify to a map[]
$ podman inspect evanrox --format '{{ .NetworkSettings.Ports }}'
map[1234/tcp:[{ 1234}]]
While this stringifies a map of {"HostIp":"","HostPort":"1234"}
to the text-values of each key-pair { 1234}
,
$ podman inspect evanrox --format '{{index .NetworkSettings.Ports "1234/tcp" 0 }}'
Why doesn't the above stringify to map[HostIp:"",HostPort:1234]
instead?