mirror of
https://github.com/containers/podman.git
synced 2025-05-17 15:18:43 +08:00
podman wait: return 0 if container never ran
Make sure to return/exit with 0 when waiting for a container that never ran. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -303,7 +303,7 @@ func (r *ConmonOCIRuntime) UpdateContainerStatus(ctr *Container) error {
|
||||
ctr.state.ExitCode = -1
|
||||
ctr.state.FinishedTime = time.Now()
|
||||
ctr.state.State = define.ContainerStateExited
|
||||
return nil
|
||||
return ctr.runtime.state.AddContainerExitCode(ctr.ID(), ctr.state.ExitCode)
|
||||
}
|
||||
return fmt.Errorf("error getting container %s state. stderr/out: %s: %w", ctr.ID(), out, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user