error when using a variable for PublishPort in systemd .container
Closed this issue · 0 comments
LangDuTienTu commented
Feature request description
Atm if I use variable for PublishPort
such as PublishPort=${PORT}:${PORT}
, quadlet dryrun would show error message and quadlet cannot generate systemd service
invalid port format '${PORT}'
While we may use variable for Volume
, why not PublishPort
:3
Suggest potential solution
As the discussion: #24072
The reason it does not work for ports is that Quadlet does some validation checks: https://github.com/containers/podman/blob/main/pkg/systemd/quadlet/quadlet.go#L1957
Quadlet should only validate/parse the input when there's a strong reason, Quadlet could just pass on the value to --publish and let Podman take it from there
Have you considered any alternatives?
No response
Additional context
No response