-
Notifications
You must be signed in to change notification settings - Fork 19
No option to publish ports on pod #64
Comments
The work-around I'm using for this is: def create_pod(client, ident=None, cgroupparent=None, labels=None, share=None,
infra=False, publish=[]):
"""Create a new empty pod."""
infra = infra or bool(publish)
if not share and infra:
share = ['cgroup', 'ipc', 'net', 'uts']
config = ConfigDict(
name=ident,
cgroupParent=cgroupparent,
labels=labels,
share=share,
infra=infra,
publish=publish
)
with client._client() as podman:
result = podman.CreatePod(config)
details = podman.GetPod(result['pod'])
return Pod(client._client, result['pod'], details['pod']) |
Also, the default container network configuration interferes with this. |
It seems you are right the I think it's weird because python-podman is aligned with libpod 1.6.0 who was released on the last October (3-4 months ago) and the publish param was added to the varlink interface more than 1 years ago, so I think it's part to the libpod 1.6.0. I think it's an issue and it need to be available in python-podman 1.6.0 |
I proposed a fix to realign the master with the latest signature of this interface. Anyway it will part of a future release (surely 1.6.1) |
It can be interesting to implement some automatized check to verify if python-podman implementation differ from defined interfaces on libpod. These check could be either triggered on pushed changes on the interface description file on the libpod side or triggered daily on the python-podman side trough some cron job and travis-ci. I will try to spend time in the next weeks to propose this kind of feature. |
We can refer to this proposal to manage this kind of issue in the future. |
Looking at the varlink schema, there's an option to set the published ports when creating a pod.
https://github.com/containers/libpod/blob/9758a975e67bb9d681d351aea0d858ace598dcdf/cmd/podman/varlink/io.podman.varlink#L451-L460
This library doesn't seem to expose that.
python-podman/podman/libs/pods.py
Lines 126 to 144 in 4aa1533
The text was updated successfully, but these errors were encountered: