Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
kill: Don't return an error if container state is 'created'
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Sebastien Boeuf committed Jun 26, 2017
1 parent 2c431f7 commit bcba230
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kill.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit bcba230

Please sign in to comment.