Skip to content

Commit 16a0592

Browse files
committed
oci: raise an error if deleting a 'created' container
Signed-off-by: Giuseppe Scrivano <[email protected]>
1 parent fd1928e commit 16a0592

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/libcrun/container.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -827,14 +827,7 @@ container_delete_internal (struct libcrun_context_s *context, oci_container *def
827827
if (UNLIKELY (ret < 0))
828828
return ret;
829829
if (ret == 1)
830-
{
831-
ret = libcrun_status_has_read_exec_fifo (state_root, id, err);
832-
if (UNLIKELY (ret < 0))
833-
return ret;
834-
if (ret == 0)
835-
return crun_make_error (err, 0, "the container '%s' is still running", id);
836-
kill (status.pid, 9);
837-
}
830+
return crun_make_error (err, 0, "the container '%s' is not in 'stopped' state", id);
838831
}
839832
}
840833

0 commit comments

Comments
 (0)