mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 20:24:31 +00:00
shimv2: log a warning and continue on post-stop hook failure
According to runtime-spec: The poststop hooks MUST be invoked by the runtime. If any poststop hook fails, the runtime MUST log a warning, but the remaining hooks and lifecycle continue as if the hook had succeeded. Fixes: #1252 Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
This commit is contained in:
parent
4de21e3d95
commit
e7043fe284
@ -29,7 +29,9 @@ func deleteContainer(ctx context.Context, s *service, c *container) error {
|
|||||||
|
|
||||||
// Run post-stop OCI hooks.
|
// Run post-stop OCI hooks.
|
||||||
if err := katautils.PostStopHooks(ctx, *c.spec, s.sandbox.ID(), c.bundle); err != nil {
|
if err := katautils.PostStopHooks(ctx, *c.spec, s.sandbox.ID(), c.bundle); err != nil {
|
||||||
return err
|
// log warning and continue, as defined in oci runtime spec
|
||||||
|
// https://github.com/opencontainers/runtime-spec/blob/master/runtime.md#lifecycle
|
||||||
|
shimLog.WithError(err).Warn("Failed to run post-stop hooks")
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.mounted {
|
if c.mounted {
|
||||||
|
Loading…
Reference in New Issue
Block a user