containers / podlet

Generate Podman Quadlet files from a Podman command, compose file, or existing object
https://crates.io/crates/podlet
Mozilla Public License 2.0
322 stars 10 forks source link

fix(container): support `service:*` as `network_mode` #39

Closed trijpstra-fourlights closed 6 months ago

trijpstra-fourlights commented 6 months ago

Closes #38

k9withabone commented 6 months ago

Thanks for submitting a PR!

While the compose spec does support service:* for network_mode, podman does not. See the podman run --network documentation. I'm not sure how podman compose handles this, but it would be interesting to know.

One option is to convert it to the container: network mode. That would involve resolving the service name to the container name, however, this is ... difficult. Another option is to have a better error message for service:, suggesting the use of container: instead and linking to the podman docs.

trijpstra-fourlights commented 6 months ago

Hmm, it seems you are right. However, I am using this in my current compose and running that with podman.

Looking at the PR that introduced this behavior in podman compose, it seems that they are actively rewriting it to container:* in the case of service:*.

Feels like a weird workaround in podman compose. I'll update my compose file then and I guess this PR can then be closed.

Sorry for wasting your time!

k9withabone commented 6 months ago

Sorry for wasting your time!

No need to be sorry, it wasn't a waste of time :smile: . I enjoy helping people, and it's good to know where the rough edges in podlet are.

I'll close this PR and either you or I can add the more specific error message for the service network mode.