From ed05122d88a7dc852f3dea41dfebfd8d1824d6e4 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Fri, 9 Oct 2026 13:41:31 -0700 Subject: [PATCH] runtime: allow delete of a created container Since before runtime-spec v1.0.0, both runc and crun implement `delete` of a container in the `created` state by terminating the container process and then deleting the container, rather than generating an error. This is useful in practice, since a container which was created but never started can not otherwise reach the `stopped` state without an explicit `kill`. Relax the spec to allow this behavior, while keeping the current one (generating an error) valid as well. Deleting a container in any state other than `created` or `stopped` still MUST generate an error. See also: https://github.com/opencontainers/runc/issues/1774 Signed-off-by: Kir Kolyshkin --- runtime.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime.md b/runtime.md index 3e111c63b..d22cd9e5c 100644 --- a/runtime.md +++ b/runtime.md @@ -139,7 +139,8 @@ This operation MUST send the specified signal to the container process. `delete ` This operation MUST [generate an error](#errors) if it is not provided the container ID. -Attempting to `delete` a container that is not [`stopped`](#state) MUST have no effect on the container and MUST [generate an error](#errors). +Attempting to `delete` a container that is neither [`created`](#state) nor [`stopped`](#state) MUST have no effect on the container and MUST [generate an error](#errors). +Attempting to `delete` a container that is [`created`](#state) MAY either have no effect on the container and [generate an error](#errors), or terminate the container process and then delete the container. Deleting a container MUST delete the resources that were created during the `create` step. Note that resources associated with the container, but not created by this container, MUST NOT be deleted. Once a container is deleted its ID MAY be used by a subsequent container.