Open skyblaster opened 1 month ago
Yeah it doesn't look very nice, to be honest I still don't understand why this is shown at all in docker... Adding a new cli options seems awkward (would you actual remember to type this?). Having to use a special option every time is not great. Also why should this be specific to macvlan? This effects all modes in the same way. Maybe we should add a containers.conf to turn this off? This way it would only need to be set once on the host.
One other option is to trim off ports when the result string length is greater than 20 (or some other number?). This is already done for the command field. But that would not be fully compatible with docker.
I noticed one other problem though we do not merge ranges for exposed ports, docker does. That is certainly something that has to be fixed.
Yeah it doesn't look very nice, to be honest I still don't understand why this is shown at all in docker... Adding a new cli options seems awkward (would you actual remember to type this?). Having to use a special option every time is not great. Also why should this be specific to macvlan? This effects all modes in the same way. Maybe we should add a containers.conf to turn this off? This way it would only need to be set once on the host.
Yes. An option in containers.conf to default to the Podman ps output prior to 5.1 would be an excellent idea.
Regarding macvlan. It's just where I noticed the change the most, seeing how the output went from nothing to a wall of text.
One other option is to trim off ports when the result string length is greater than 20 (or some other number?). This is already done for the command field. But that would not be fully compatible with docker.
I noticed one other problem though we do not merge ranges for exposed ports, docker does. That is certainly something that has to be fixed.
This would clean things up substantially. I don't use Docker, so I didn't realize it grouped ports into ranges.
I noticed one other problem though we do not merge ranges for exposed ports, docker does. That is certainly something that has to be fixed.
This would clean things up substantially. I don't use Docker, so I didn't realize it grouped ports into ranges.
Well given you example this would not help much only 67/udp, 68/udp
would be grouped into 67-68/udp
Well given you example this would not help much only
67/udp, 68/udp
would be grouped into67-68/udp
True, that wasn't the best example. The FreeSWITCH example I referenced first was much better. It's just that I couldn't link to a public image for demo purposes.
This is just a small sample of the wall of text I was referring to:
65235/udp, 65236/udp, 65237/udp, 65238/udp, 65239/udp, 65240/udp, 65241/udp, 65242/udp, 65243/udp, 65244/udp, 65245/udp, 65246/udp, 65247/udp, 65248/udp, 65249/udp, 65250/udp, 65251/udp, 65252/udp, 65253/udp, 65254/udp, 65255/udp, 65256/udp, 65257/udp, 65258/udp, 65259/udp, 65260/udp, 65261/udp, 65262/udp, 65263/udp, 65264/udp, 65265/udp, 65266/udp, 65267/udp, 65268/udp, 65269/udp, 65270/udp, 65271/udp, 65272/udp, 65273/udp, 65274/udp, 65275/udp, 65276/udp, 65277/udp, 65278/udp, 65279/udp, 65280/udp, 65281/udp, 65282/udp, 65283/udp, 65284/udp, 65285/udp, 65286/udp, 65287/udp, 65288/udp, 65289/udp, 65290/udp, 65291/udp, 65292/udp, 65293/udp, 65294/udp, 65295/udp, 65296/udp, 65297/udp, 65298/udp, 65299/udp, 65300/udp, 65301/udp, 65302/udp, 65303/udp, 65304/udp, 65305/udp, 65306/udp, 65307/udp, 65308/udp, 65309/udp, 65310/udp, 65311/udp, 65312/udp, 65313/udp, 65314/udp, 65315/udp, 65316/udp, 65317/udp, 65318/udp, 65319/udp, 65320/udp, 65321/udp, 65322/udp, 65323/udp, 65324/udp, 65325/udp, 65326/udp, 65327/udp, 65328/udp, 65329/udp, 65330/udp, 65331/udp, 65332/udp, 65333/udp, 65334/udp, 65335/udp, 65336/udp, 65337/udp, 65338/udp, 65339/udp, 65340/udp, 65341/udp, 65342/udp, 65343/udp, 65344/udp, 65345/udp, 65346/udp, 65347/udp, 65348/udp, 65349/udp, 65350/udp, 65351/udp, 65352/udp, 65353/udp, 65354/udp, 65355/udp, 65356/udp, 65357/udp, 65358/udp, 65359/udp, 65360/udp, 65361/udp, 65362/udp, 65363/udp, 65364/udp, 65365/udp, 65366/udp, 65367/udp, 65368/udp, 65369/udp, 65370/udp, 65371/udp, 65372/udp, 65373/udp, 65374/udp, 65375/udp, 65376/udp, 65377/udp, 65378/udp, 65379/udp, 65380/udp, 65381/udp, 65382/udp, 65383/udp, 65384/udp, 65385/udp, 65386/udp, 65387/udp, 65388/udp, 65389/udp, 65390/udp, 65391/udp, 65392/udp, 65393/udp, 65394/udp, 65395/udp, 65396/udp, 65397/udp, 65398/udp, 65399/udp, 65400/udp, 65401/udp, 65402/udp, 65403/udp, 65404/udp, 65405/udp, 65406/udp, 65407/udp, 65408/udp, 65409/udp, 65410/udp, 65411/udp, 65412/udp, 65413/udp, 65414/udp, 65415/udp, 65416/udp, 65417/udp, 65418/udp, 65419/udp, 65420/udp, 65421/udp, 65422/udp, 65423/udp, 65424/udp, 65425/udp, 65426/udp, 65427/udp, 65428/udp, 65429/udp, 65430/udp, 65431/udp, 65432/udp, 65433/udp, 65434/udp, 65435/udp, 65436/udp, 65437/udp, 65438/udp, 65439/udp, 65440/udp, 65441/udp, 65442/udp, 65443/udp, 65444/udp, 65445/udp, 65446/udp, 65447/udp, 65448/udp, 65449/udp, 65450/udp, 65451/udp, 65452/udp, 65453/udp, 65454/udp, 65455/udp, 65456/udp, 65457/udp, 65458/udp, 65459/udp, 65460/udp, 65461/udp, 65462/udp, 65463/udp, 65464/udp, 65465/udp, 65466/udp, 65467/udp, 65468/udp, 65469/udp, 65470/udp, 65471/udp, 65472/udp, 65473/udp, 65474/udp, 65475/udp, 65476/udp, 65477/udp, 65478/udp, 65479/udp, 65480/udp, 65481/udp, 65482/udp, 65483/udp, 65484/udp, 65485/udp, 65486/udp, 65487/udp, 65488/udp, 65489/udp, 65490/udp, 65491/udp, 65492/udp, 65493/udp, 65494/udp, 65495/udp, 65496/udp, 65497/udp, 65498/udp, 65499/udp, 65500/udp, 65501/udp, 65502/udp, 65503/udp, 65504/udp, 65505/udp, 65506/udp, 65507/udp, 65508/udp, 65509/udp, 65510/udp, 65511/udp, 65512/udp, 65513/udp, 65514/udp, 65515/udp, 65516/udp, 65517/udp, 65518/udp, 65519/udp, 65520/udp, 65521/udp, 65522/udp, 65523/udp, 65524/udp, 65525/udp, 65526/udp, 65527/udp, 65528/udp, 65529/udp, 65530/udp, 65531/udp, 65532/udp, 65533/udp, 65534/udp, 65535/udp systemd-freeswitch
I did attempt a fix, which does work, however I'm sure the code quality is not up to par for this project: https://github.com/containers/podman/compare/main...skyblaster:podman:exposed-port-ranges-ps
This brings up another area that could benefit from grouping.
Here's a snippet from podman image inspect freeswitch
:
"Config": {
"ExposedPorts": {
"16384-32768/udp": {},
"5060/tcp": {},
"5060/udp": {},
"5061/tcp": {},
"5061/udp": {},
"5066/tcp": {},
"5080/tcp": {},
"5080/udp": {},
"5081/tcp": {},
"5081/udp": {},
"64535-65535/udp": {},
"7443/tcp": {},
"8021/tcp": {},
"8081/tcp": {},
"8082/tcp": {}
},
Which is very different from the non-grouped output of podman inspect systemd-freeswitch
:
"Ports": {
"16384/udp": null,
"16385/udp": null,
"16386/udp": null,
"16387/udp": null,
"16388/udp": null,
"16389/udp": null,
...
...
...
"65519/udp": null,
"65520/udp": null,
"65521/udp": null,
"65522/udp": null,
"65523/udp": null,
"65524/udp": null,
"65525/udp": null,
"65526/udp": null,
"65527/udp": null,
"65528/udp": null,
"65529/udp": null,
"65530/udp": null,
"65531/udp": null,
"65532/udp": null,
"65533/udp": null,
"65534/udp": null,
"65535/udp": null,
"7443/tcp": null,
"8021/tcp": null,
"8081/tcp": null,
"8082/tcp": null
},
I believe the podman inspect output must be that way for docker compat, they do not group port ranges there AFAIK.
Issue Description
After a recent upgrade from 5.0.3 to 5.1.0, I noticed that podman ps is unreadable. This is due to my FreeSWITCH container, which uses a macvlan network and has many exposed ports (see here). Prior to 5.1, this and other containers using macvlan networks would not list any ports at all.
This appears to be intended behaviour introduced by PR https://github.com/containers/podman/pull/22319 Is it possible to add a flag to mute port information for macvlan containers?
Steps to reproduce the issue
Steps to reproduce the issue...using adguardhome as an example:
Describe the results you received
Describe the results you expected
podman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
No
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting