mirror of
https://github.com/containers/podman.git
synced 2025-05-21 17:16:22 +08:00
KillContainer: improve error message
To improve the error message reported in #16142 where the container is reported to be in the wrong state but we do not know which. This is not a fix for #16142 but will hopefully aid in better understanding what's going on if it flakes again. [NO NEW TESTS NEEDED] as hitting the condition is inherently racy. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -376,7 +376,7 @@ func (r *ConmonOCIRuntime) KillContainer(ctr *Container, signal uint, all bool)
|
||||
logrus.Infof("Error updating status for container %s: %v", ctr.ID(), err2)
|
||||
}
|
||||
if ctr.ensureState(define.ContainerStateStopped, define.ContainerStateExited) {
|
||||
return define.ErrCtrStateInvalid
|
||||
return fmt.Errorf("%w: %s", define.ErrCtrStateInvalid, ctr.state.State)
|
||||
}
|
||||
return fmt.Errorf("sending signal to container %s: %w", ctr.ID(), err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user