runc/patch/0018-runc-do-not-kill-container-if-poststart-hooks-execut.patch
2023-01-05 17:23:54 +08:00

29 lines
989 B
Diff

From 7140cab44cd368e987089b66948cfc7f8a414b83 Mon Sep 17 00:00:00 2001
From: zhongjiawei <zhongjiawei1@huawei.com>
Date: Thu, 5 Jan 2023 16:35:55 +0800
Subject: [PATCH] runc:do not kill container if poststart hooks execute failed
---
libcontainer/container_linux.go | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go
index 425e44d..10890c1 100644
--- a/libcontainer/container_linux.go
+++ b/libcontainer/container_linux.go
@@ -367,10 +367,7 @@ func (c *linuxContainer) start(process *Process) (retErr error) {
}
if err := c.config.Hooks[configs.Poststart].RunHooks(s); err != nil {
- if err := ignoreTerminateErrors(parent.terminate()); err != nil {
- logrus.Warn(fmt.Errorf("error running poststart hook: %w, ContainerId: %s", err, s.ID))
- }
- return err
+ logrus.Warn(fmt.Errorf("error running poststart hook: %w, ContainerId: %s", err, s.ID))
}
}
}
--
2.30.0