Paul Holzinger
edb64f8a76
libpod: stop containers with --restart=always
...
Commit 1ab833fb73 improved the situation but it is still not enough.
If you run short lived containers with --restart=always podman is
basically permanently restarting them. To only way to stop this is
podman stop. However podman stop does not do anything when the
container is already in a not running state. While this makes sense we
should still mark the container as explicitly stopped by the user.
Together with the change in shouldRestart() which now checks for
StoppedByUser this makes sure the cleanup process is not going to start
it back up again.
A simple reproducer is:
```
podman run --restart=always --name test -d alpine true
podman stop test
```
then check if the container is still running, the behavior is very
flaky, it took me like 20 podman stop tries before I finally hit the
correct window were it was stopped permanently.
With this patch it worked on the first try.
Fixes #18259
[NO NEW TESTS NEEDED] This is super flaky and hard to correctly test
in CI. MY ginkgo v2 work seems to trigger this in play kube tests so
that should catch at least some regressions. Also this may be something
that should be tested at podman test days by users (#17912 ).
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-20 11:23:05 +02:00
..
2023-04-03 11:08:29 -04:00
2022-01-18 12:47:07 +01:00
2023-03-15 10:28:16 +01:00
2022-03-18 09:11:53 +01:00
2023-02-09 21:56:27 +01:00
2023-02-20 13:58:15 +01:00
2022-10-17 09:19:41 +02:00
2023-02-28 13:45:36 -05:00
2023-02-22 11:00:50 -05:00
2022-08-23 15:31:00 +01:00
2023-02-22 11:00:50 -05:00
2022-01-18 12:47:07 +01:00
2023-04-20 11:23:05 +02:00
2023-01-16 16:28:11 +01:00
2023-03-13 14:21:12 -04:00
2022-09-20 08:36:23 +01:00
2022-09-20 08:36:23 +01:00
2022-09-20 08:36:23 +01:00
2022-09-20 08:36:23 +01:00
2023-01-30 15:43:03 +01:00
2022-12-16 18:30:12 +01:00
2022-01-18 12:47:07 +01:00
2022-09-14 13:44:48 -04:00
2022-09-15 08:10:34 +01:00
2023-02-20 14:51:04 +01:00
2023-02-09 21:56:27 +01:00
2023-03-31 19:48:03 +02:00
2023-03-31 19:48:03 +02:00
2023-02-07 09:34:15 -05:00
2023-03-31 19:48:03 +02:00
2023-02-24 08:25:04 -05:00
2022-09-05 10:12:12 +01:00
2023-04-20 11:23:05 +02:00
2022-12-16 18:30:12 +01:00
2023-02-20 13:58:16 +01:00
2023-02-20 13:58:16 +01:00
2023-02-20 13:58:16 +01:00
2022-09-14 17:09:04 +02:00
2022-10-17 09:19:41 +02:00
2023-02-09 21:56:27 +01:00
2022-09-20 08:36:23 +01:00
2022-09-20 08:36:23 +01:00
2022-09-20 08:36:23 +01:00
2022-10-17 16:43:53 +01:00
2022-09-10 07:52:00 -04:00
2022-10-17 16:43:53 +01:00
2022-08-23 15:31:00 +01:00
2022-12-16 14:20:14 +01:00
2023-01-03 13:21:24 -05:00
2022-07-05 16:06:32 +02:00
2022-03-23 19:05:29 +01:00
2022-11-29 10:40:24 +01:00
2022-12-08 15:01:57 +01:00
2022-12-05 20:58:30 +01:00
2022-12-02 16:41:21 +00:00
2023-03-20 13:56:00 +01:00
2022-09-10 07:52:00 -04:00
2022-09-10 07:52:00 -04:00
2022-11-13 10:56:15 +00:00
2022-08-24 10:55:52 +01:00
2023-03-02 13:43:11 +01:00
2023-04-08 00:53:38 -04:00
2022-03-18 09:11:53 +01:00
2023-04-18 15:14:22 +02:00
2023-02-09 21:56:27 +01:00
2022-04-25 13:23:20 +02:00
2023-04-18 15:18:05 +02:00
2022-09-20 15:34:27 -04:00
2022-12-16 18:30:12 +01:00
2023-02-09 21:56:27 +01:00
2023-02-09 21:56:27 +01:00
2022-10-17 09:19:41 +02:00
2022-08-18 08:07:30 +01:00
2022-08-18 08:05:42 +01:00
2023-04-14 22:40:47 +02:00
2022-09-20 15:34:27 -04:00
2022-09-07 07:58:37 +01:00
2022-09-07 07:58:37 +01:00
2022-08-29 13:04:04 +01:00
2022-10-12 13:45:49 +02:00
2022-08-18 08:07:30 +01:00
2020-06-25 17:16:12 +02:00
2022-09-01 13:02:01 -04:00
2022-07-05 16:06:32 +02:00
2022-10-17 09:19:41 +02:00
2023-03-13 14:21:12 -04:00
2022-12-15 20:19:53 -05:00
2022-10-07 08:26:10 +01:00
2022-10-07 08:26:10 +01:00
2023-02-22 11:00:50 -05:00
2022-01-18 12:47:07 +01:00
2022-05-25 12:30:19 +02:00
2022-08-17 11:45:07 +01:00
2023-03-09 12:36:52 -05:00
2022-12-01 16:05:13 +01:00
2022-09-22 13:07:40 -04:00
2022-09-05 10:20:50 +01:00
2022-09-05 10:20:50 +01:00
2023-03-29 11:31:35 +02:00
2023-03-21 16:00:54 -04:00
2022-08-17 11:45:07 +01:00
2023-04-11 10:57:46 +02:00
2022-10-07 08:27:27 +01:00
2022-10-07 08:27:27 +01:00
2022-10-07 08:27:27 +01:00
2022-10-07 08:27:27 +01:00
2022-07-04 15:39:00 +02:00
2023-01-26 10:20:38 +01:00
2022-09-01 10:27:04 +01:00
2023-03-15 14:45:18 -04:00
2022-09-27 16:31:40 +01:00
2022-07-04 15:39:00 +02:00
2022-05-25 10:17:46 +02:00
2023-04-11 10:57:46 +02:00
2023-02-28 13:45:36 -05:00
2023-03-17 13:24:53 -04:00
2023-03-28 11:27:43 +02:00
2023-02-22 11:00:50 -05:00
2023-02-22 11:00:50 -05:00
2022-09-14 08:29:26 +01:00
2022-11-28 12:26:41 +01:00
2022-11-28 12:26:41 +01:00
2022-09-14 08:29:26 +01:00
2023-04-05 17:58:30 -04:00
2023-03-09 12:36:52 -05:00
2023-03-09 12:36:52 -05:00
2023-03-09 12:36:52 -05:00
2022-01-18 12:47:07 +01:00
2023-03-09 12:36:52 -05:00
2022-12-15 23:18:50 +01:00
2022-09-22 13:07:40 -04:00
2022-09-27 16:31:40 +01:00
2022-09-27 16:31:40 +01:00
2022-09-27 16:31:40 +01:00
2022-09-27 16:31:40 +01:00
2023-02-22 11:00:50 -05:00
2023-03-15 14:45:18 -04:00