From dc42304f3804632d01345478ab9b1f122b48d516 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Mon, 1 Apr 2019 18:17:16 -0400 Subject: Sending signals to containers prevents restart policy Noticed this when testing some behavior with Docker. Signed-off-by: Matthew Heon --- libpod/pod_api.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libpod/pod_api.go') diff --git a/libpod/pod_api.go b/libpod/pod_api.go index 9a6baf23e..9ed5c88eb 100644 --- a/libpod/pod_api.go +++ b/libpod/pod_api.go @@ -364,6 +364,13 @@ func (p *Pod) Kill(signal uint) (map[string]error, error) { } logrus.Debugf("Killed container %s with signal %d", ctr.ID(), signal) + + ctr.state.StoppedByUser = true + if err := ctr.save(); err != nil { + ctrErrors[ctr.ID()] = err + } + + ctr.lock.Unlock() } if len(ctrErrors) > 0 { -- cgit v1.2.3-54-g00ecf