From 780f52d6f9fca130d26a0ec95f3814ffb2d39a25 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Fri, 23 Jun 2017 15:36:46 -0700 Subject: [PATCH] kill: Don't return an error if container state is 'created' Regarding a recent update of the OCI specification, we don't want to generate an error when 'kill' command is called on a container which has been created but not started. This is basically a no-op in our case. Signed-off-by: Sebastien Boeuf --- kill.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kill.go b/kill.go index f4dddbb7..7ca2d039 100644 --- a/kill.go +++ b/kill.go @@ -106,8 +106,11 @@ func kill(containerID, signal string, all bool) error { containerID = status.ID - // container MUST be running - if status.State.State != vc.StateRunning { + // container MUST be created or running + if status.State.State == vc.StateReady { + ccLog.Infof("Container %s state 'created', nothing to do", containerID) + return nil + } else if status.State.State != vc.StateRunning { return fmt.Errorf("Container %s is not running", containerID) }