mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-31 08:28:34 +00:00
Merge pull request #1253 from snir911/fix-poststop
shimv2: log a warning and continue on post-stop hook failure
This commit is contained in:
@@ -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 {
|
||||||
|
@@ -52,7 +52,9 @@ func startContainer(ctx context.Context, s *service, c *container) error {
|
|||||||
return katautils.PostStartHooks(ctx, *c.spec, s.sandbox.ID(), c.bundle)
|
return katautils.PostStartHooks(ctx, *c.spec, s.sandbox.ID(), c.bundle)
|
||||||
})
|
})
|
||||||
if err != nil {
|
if 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-start hooks")
|
||||||
}
|
}
|
||||||
|
|
||||||
c.status = task.StatusRunning
|
c.status = task.StatusRunning
|
||||||
|
Reference in New Issue
Block a user