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 auto-update doesn't work with containers that managed by the pod's systemd unit file #6770

Closed
floating-cat opened this issue Jun 25, 2020 · 1 comment · Fixed by #6771
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
I have a pod, and there are several containes in this pod. I use podman generate systemd --new --name pod_name to creates systems unit files.
But I can't use podman auto-update to update the containers in this pod.

Steps to reproduce the issue:

  1. I use simliar commands below to create pod, containers, and systems unit files:
podman pod create --name pod_a
podman create --name caddy --pod pod_a --label io.containers.autoupdate=image caddy:latest
# create some other containers, omit here for simplification
podman generate systemd --new --files --name pod_a
# remove pod and containers here then use systemctl to manage/create them
podman pod rm pod_a
sudo cp {pod-pod_a,container-caddy}.service /etc/systemd/system/
sudo systemctl enable --now pod-pod_a
  1. Some container's images release new versions.

  2. Use the podman auto-update.

Describe the results you received:
Podman shows the errors below:

...
Writing manifest to image destination
Storing signatures
Error: 3 errors occurred:
        * error auto-updating container "f151413c69619c902d8b599f159a6b83826bd6f55ce78a9afbfbe16bbcfb321b": restarting systemd unit "container-caddy.service" failed: Operation refused, unit container-caddy.service may be requested by dependency only (it is configured to refuse manual start/stop).
...

It seems the podman tries to restart these container services here. It doesn't work because these containers' systems unit files are created by podman generate systemd --new --files --name pod_a. These systems unit files contain RefuseManualStart=yes and RefuseManualStop=yes. So the podman failed to restart them here.

Describe the results you expected:
The podman should stop the pod (it would also stop its containers), update the images, then start the pod service.
Or some other ways that can update the containers without any problem.

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

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

Additional information:
I tried to add io.containers.autoupdate=image label in this pod instead of this pod's containers.
Then use podman auto-update to update the containers. But it doesn't work, too.

edited:
After some thought, this issue might be a feature instead of a bug. So feel free to change the label of the issue to the feature.
Also, it might be a good idea/feature to add the io.containers.autoupdate label for pod instead of the containers here. Then podman check this pod's containers version and update them.

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 25, 2020
vrothberg added a commit to vrothberg/libpod that referenced this issue Jun 25, 2020
Allow manual restarts of container units that are part of a pod.
This allows for configuring these containers for auto updates.

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

Thanks for the report, I opened #6771 to fix it.

mheon pushed a commit to mheon/libpod that referenced this issue Jun 25, 2020
Allow manual restarts of container units that are part of a pod.
This allows for configuring these containers for auto updates.

Fixes: containers#6770
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