shimv2: log a warning and continue on post-start hook failure
According to runtime-spec:
The poststart hooks MUST be invoked by the runtime. If any poststart
hook fails, the runtime MUST log a warning, but the remaining hooks
and lifecycle continue as if the hook had succeeded
Fixes:
@@ -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)
})
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
