mirror of
https://github.com/containers/podman.git
synced 2025-10-18 03:33:32 +08:00
libpod: reset state error on init
If we manage to init/start a container successfully we should unset any previously stored state errors. Otherwise a user might be confused why there is an error in the state about some old error even though the container works/runs. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -1106,6 +1106,9 @@ func (c *Container) init(ctx context.Context, retainRetries bool) error {
|
||||
c.state.RestoreLog = ""
|
||||
c.state.ExitCode = 0
|
||||
c.state.Exited = false
|
||||
// Reset any previous errors as we try to init it again, either it works and we don't
|
||||
// want to keep an old error around or a new error will be written anyway.
|
||||
c.state.Error = ""
|
||||
c.state.State = define.ContainerStateCreated
|
||||
c.state.StoppedByUser = false
|
||||
c.state.RestartPolicyMatch = false
|
||||
|
Reference in New Issue
Block a user