mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-15 16:13:20 +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
4be3aebd15
commit
322839ac75
@ -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