aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-06-09 12:54:04 -0400
committerGitHub <noreply@github.com>2022-06-09 12:54:04 -0400
commitfd1d0d67fbc1b7c26799370dc153009f9dde50bb (patch)
tree948700452c97f53a559b602643b2df4c7c8d6059
parent852a40685103022bf66ae9f4518c70632d9a0203 (diff)
parentc77691f06f619bf15d0f83690a1dbbfe72f92b7a (diff)
downloadpodman-fd1d0d67fbc1b7c26799370dc153009f9dde50bb.tar.gz
podman-fd1d0d67fbc1b7c26799370dc153009f9dde50bb.tar.bz2
podman-fd1d0d67fbc1b7c26799370dc153009f9dde50bb.zip
Merge pull request #14533 from mheon/avoid_error_on_container_stop
Do not error on signalling a just-stopped container
-rw-r--r--libpod/oci_conmon_linux.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go
index 6aa7ce6dc..0c1ee61d3 100644
--- a/libpod/oci_conmon_linux.go
+++ b/libpod/oci_conmon_linux.go
@@ -411,8 +411,8 @@ func (r *ConmonOCIRuntime) KillContainer(ctr *Container, signal uint, all bool)
if err2 := r.UpdateContainerStatus(ctr); err2 != nil {
logrus.Infof("Error updating status for container %s: %v", ctr.ID(), err2)
}
- if ctr.state.State == define.ContainerStateExited {
- return nil
+ if ctr.ensureState(define.ContainerStateStopped, define.ContainerStateExited) {
+ return define.ErrCtrStateInvalid
}
return errors.Wrapf(err, "error sending signal to container %s", ctr.ID())
}