Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when using a variable for PublishPort in systemd .container #24081

Closed
LangDuTienTu opened this issue Sep 26, 2024 · 0 comments · Fixed by #24119
Closed

error when using a variable for PublishPort in systemd .container #24081

LangDuTienTu opened this issue Sep 26, 2024 · 0 comments · Fixed by #24119
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. quadlet

Comments

@LangDuTienTu
Copy link

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

@LangDuTienTu LangDuTienTu added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 26, 2024
@Luap99 Luap99 added the quadlet label Sep 26, 2024
@vrothberg vrothberg added kind/bug Categorizes issue or PR as related to a bug. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Sep 26, 2024
@vrothberg vrothberg changed the title Variable for PublishPort in systemd .container error when using a variable for PublishPort in systemd .container Sep 26, 2024
@Luap99 Luap99 self-assigned this Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. quadlet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants