mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-02 13:44:33 +00:00
runtime: force stop container after the container process exits
Set thestop container force flag to true so that the container state is always set to “StateStopped” after the container wait goroutine is finished. This is necessary for the following delete container step to succeed. Fixes: #4359 Signed-off-by: Feng Wang <feng.wang@databricks.com>
This commit is contained in:
parent
a9a3074828
commit
9726f56fdc
@ -78,7 +78,7 @@ func wait(ctx context.Context, s *service, c *container, execID string) (int32,
|
|||||||
shimLog.WithField("sandbox", s.sandbox.ID()).Error("failed to delete sandbox")
|
shimLog.WithField("sandbox", s.sandbox.ID()).Error("failed to delete sandbox")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if _, err = s.sandbox.StopContainer(ctx, c.id, false); err != nil {
|
if _, err = s.sandbox.StopContainer(ctx, c.id, true); err != nil {
|
||||||
shimLog.WithError(err).WithField("container", c.id).Warn("stop container failed")
|
shimLog.WithError(err).WithField("container", c.id).Warn("stop container failed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user