Merge pull request #292552 from diogotcorreia/oci-containers-fix-stop-one-shot

nixos/oci-containers: ignore nonexistent container when stopping
This commit is contained in:
Sandro 2024-03-07 21:23:51 +01:00 committed by GitHub
commit 5f39678474
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -312,7 +312,7 @@ let
preStop = if cfg.backend == "podman"
then "podman stop --ignore --cidfile=/run/podman-${escapedName}.ctr-id"
else "${cfg.backend} stop ${name}";
else "${cfg.backend} stop ${name} || true";
postStop = if cfg.backend == "podman"
then "podman rm -f --ignore --cidfile=/run/podman-${escapedName}.ctr-id"