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

Commit 4ffb2c4

Browse files
author
Sebastien Boeuf
authored
Merge pull request #245 from clearcontainers/sboeuf/fix_kill
kill: Don't return an error if container state is 'created'
2 parents 157d907 + 780f52d commit 4ffb2c4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

kill.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,11 @@ func kill(containerID, signal string, all bool) error {
106106

107107
containerID = status.ID
108108

109-
// container MUST be running
110-
if status.State.State != vc.StateRunning {
109+
// container MUST be created or running
110+
if status.State.State == vc.StateReady {
111+
ccLog.Infof("Container %s state 'created', nothing to do", containerID)
112+
return nil
113+
} else if status.State.State != vc.StateRunning {
111114
return fmt.Errorf("Container %s is not running", containerID)
112115
}
113116

0 commit comments

Comments
 (0)