Merge pull request #16151 from vrothberg/debug-16142

KillContainer: improve error message
This commit is contained in:
OpenShift Merge Robot
2022-10-13 10:24:06 -04:00
committed by GitHub

View File

@ -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) logrus.Infof("Error updating status for container %s: %v", ctr.ID(), err2)
} }
if ctr.ensureState(define.ContainerStateStopped, define.ContainerStateExited) { 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) return fmt.Errorf("sending signal to container %s: %w", ctr.ID(), err)
} }