diff --git a/src/runtime/containerd-shim-v2/delete.go b/src/runtime/containerd-shim-v2/delete.go index f1d7ebbc5e..554899afa1 100644 --- a/src/runtime/containerd-shim-v2/delete.go +++ b/src/runtime/containerd-shim-v2/delete.go @@ -29,7 +29,9 @@ func deleteContainer(ctx context.Context, s *service, c *container) error { // Run post-stop OCI hooks. 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 { diff --git a/src/runtime/containerd-shim-v2/start.go b/src/runtime/containerd-shim-v2/start.go index 2f57948bac..9a81ec9591 100644 --- a/src/runtime/containerd-shim-v2/start.go +++ b/src/runtime/containerd-shim-v2/start.go @@ -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