compose icon indicating copy to clipboard operation
compose copied to clipboard

Make port arg optional in `docker compose port`

Open crazybolillo opened this issue 1 year ago • 5 comments

What I did

This comand no longer needs a mandatory port. If no port is provided it will instead list all published ports. This behavior falls in line with the behavior provided by docker port.

Related issue Closes #11859.

crazybolillo avatar Jun 01 '24 18:06 crazybolillo

Thanks for the review, I have taken care of your observations.

crazybolillo avatar Jun 04 '24 02:06 crazybolillo

while not strictly required, I think we should use this opportunity while revisiting this command to add support for app_protocol and port name (https://github.com/compose-spec/compose-spec/blob/master/05-services.md#long-syntax-3)

ndeloof avatar Jun 11 '24 06:06 ndeloof

while not strictly required, I think we should use this opportunity while revisiting this command to add support for app_protocol and port name (https://github.com/compose-spec/compose-spec/blob/master/05-services.md#long-syntax-3)

Wow, did not even know those existed. How do you envision it? Allow filtering? Or just displaying the name and app_protocol if they exist for the given port?

crazybolillo avatar Jun 12 '24 04:06 crazybolillo

Went ahead and changed backend.Port so it returns a slice of publishers. That should fix other issues like dealing with --index. Since I was modifying PortPublisher I went ahead and also changed its port members to be uint16 so it falls in line with types.Port

I think the only thing left is the question about --index incompatibility, and support for app_protocol and port name,

crazybolillo avatar Jun 12 '24 06:06 crazybolillo

--index is used to select service replica, already implemented in backend.Port calling getSpecifiedContainer Adding support for app_protocol would not be that simple, as such metadata only exists in compose model, not in actual resources. Let's keep this for a future improvement

ndeloof avatar Jun 12 '24 06:06 ndeloof