cockpit-podman
cockpit-podman copied to clipboard
feat: Network options for run images
Add network options in "Run image" dialog, as screenshot:

Add two options:
- Network Namespace Mode: for selecting
--networkoption in podman CLI/netns.nsmodein podman API, which allowsbridge/none/hostandslirp4netns(if detected inpodman info) in rootful mode (system flag), ornone/slirp4netns(if detected inpodman info) in rootless mode - CNI Networks: for selecting CNI networks using in bridge mode, which will listing CNI networks from
/libpod/networks/json(podman network lsin CLI). Without choosing this option, podman will use default network.
also solved #176
More TODOs for the network feature:
- support more ns modes and options, like
container:id,ns:path, etc. - support shows IP infos from multiple networks (from
NetworkSettings.Networks)
@marusak
support more ns modes and options, like container:id, ns:path, etc.
Do you plan to do this in this PR? Or should this be a follow up?
support shows IP infos from multiple networks (from NetworkSettings.Networks)
This is for followup, right?
both these TODOs will be in follow up PRs. because these ns modes may be too complicated on current UI, we may need to design the UI first
edit: I found that we can use dual list selector^1 to perform better CNI selection, I'm going to move to that component
--
@marusak ~~maybe we can borrow the select listview from machine's boot order selection to select CNIs, as screenshot below:~~

and provide another network mode option CNIs (or network-ids) for --network=id,id,... and keep bridge option to --network=bridge?
I have a few ideas, but if @garrett would have time to take a look and create some design that would be awesome.
But in general I would go more in the direction of what cli is doing and not what API is providing. So I would have select that would have preselected the default value (it knows if we are going to run root or rootless container so can pick the appropriate) and the select would then contain rest of the options (like none, host, bridge). network-id (CNI network) would be presented somewhat as Use defined networks... and when that one would be selected it would show that multiselect that you have there now. Very similarly it would work for other container network, just it would just show some simple select with list of available containers.
Hey! Stumbled upon this open PR as I'm trying to run a container in host mode using cockpit-podman, is it still scheduled to be added in an upcoming release of the application?
is it still scheduled to be added in an upcoming release of the application?
Hopefully one day :) Also there is redesign happening, so this would fit a bit more now, but we still need to find a good way of doing this.
https://github.com/cockpit-project/cockpit/discussions/16059
@marusak That design is awesome! Feel free to close this PR if you want to wait releasing new design.
I hope to improve this module as soon as possible
Just a quick note: We've implemented the redesign of the create container modal dialog. It now has tabs. This feature would probably also go into integration with the rest of the optional settings, some of which are also network-related.
Podman's networking stack changed quite a bit and CNI plugins are now deprecated. Closing this, feel free to re-open when you have found time to work on it.