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

podman generate systemd would create ill systemd unit files if using = in the --pod flag #6766

Closed
floating-cat opened this issue Jun 25, 2020 · 2 comments · Fixed by #6768
Closed
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@floating-cat
Copy link

floating-cat commented Jun 25, 2020

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description
The podman generate systemd would create ill systemd unit files if I use = in the --pod flag.

Steps to reproduce the issue:

  1. Run below commands:
podman pod create --name systemd-pod
podman create --pod=systemd-pod alpine top
podman generate systemd --new --name systemd-pod
  1. The podman generate systemd will generate a systems unit file with this content:
ExecStart=/usr/bin/podman run --conmon-pidfile %t/container-agitated_elgamal.pid --cidfile %t/container-agitated_elgamal.ctr-id --cgroups=no-conmon --pod-id-file %t/pod-systemd-pod.pod-id -d --pod=systemd-pod alpine top

It uses --pod-id-file and --pod at the same time when running the podman.

Describe the results you received:
When running these generated systems unit files, the podman will show Cannot specify both --pod and --pod-id-file error and exit because of this: https://github.com/containers/libpod/blob/2df3faab7b2801cc2e3c2291b618ae530223329d/cmd/podman/common/specgen.go#L259

Describe the results you expected:
We can run this generated systems unit files without any problem.

Additional information you deem important (e.g. issue happens only occasionally):

If I use the following commands, the podman generate systemd will generate the correct systemd unit files.

podman pod create --name systemd-pod
podman create --pod systemd-pod alpine top
podman generate systemd --new --name systemd-pod

Output of podman version:

Version:      2.0.0
API Version:  1
Go Version:   go1.14.4
Git Commit:   eec482cae3289ecaad45c602629657da7062ce9c
Built:        Sat Jun 20 20:30:13 2020
OS/Arch:      linux/amd64
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 25, 2020
@vrothberg vrothberg self-assigned this Jun 25, 2020
@vrothberg
Copy link
Member

Thanks for the report, @floating-cat!

vrothberg added a commit to vrothberg/libpod that referenced this issue Jun 25, 2020
When generating systemd unit for pods, we need to remove certain
pod-related flags from the containers' create commands.  Make sure
to account for all the syntax including a single argument with key and
value being split by `=`.

Fixes: containers#6766
Signed-off-by: Valentin Rothberg <[email protected]>
@vrothberg
Copy link
Member

Opened #6768 to fix it.

mheon pushed a commit to mheon/libpod that referenced this issue Jul 6, 2020
When generating systemd unit for pods, we need to remove certain
pod-related flags from the containers' create commands.  Make sure
to account for all the syntax including a single argument with key and
value being split by `=`.

Fixes: containers#6766
Signed-off-by: Valentin Rothberg <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants