From e58415ad4f1e118a54c5d773e9873f65aa4f44c9 Mon Sep 17 00:00:00 2001
From: liuhao <liuhao27@huawei.com>
Date: Wed, 24 Apr 2019 22:22:55 +0800
Subject: [PATCH 087/131] lxc: adapt to spec of oci hook

poststart failed do not cause run failed

Signed-off-by: liuhao <liuhao27@huawei.com>
Signed-off-by: LiFeng <lifeng68@huawei.com>
---
 src/lxc/conf.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 8cdccf13..a1d77ebc 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -4782,6 +4782,7 @@ static int run_oci_hooks(const char *name, const char *lxcpath, struct lxc_conf
 	struct oci_hook_conf work_conf = {0};
 	size_t i;
 	int ret = 0;
+	int nret = 0;
 	char *rootpath;
 
 	if (!lc) {
@@ -4811,9 +4812,9 @@ static int run_oci_hooks(const char *name, const char *lxcpath, struct lxc_conf
 		case OCI_HOOK_POSTSTART:
 			for (i = 0; i < lc->ocihooks->poststart_len; i++) {
 				work_conf.ocihook = lc->ocihooks->poststart[i];
-				ret = run_ocihook_script_argv(name, "lxc", &work_conf, lxcpath, rootpath);
-				if (ret != 0)
-					break;
+				nret = run_ocihook_script_argv(name, "lxc", &work_conf, lxcpath, rootpath);
+				if (nret != 0)
+					WARN("running poststart hook %d failed, ContainerId: %s", i, name);
 			}
 			break;
 		case OCI_HOOK_POSTSTOP:
-- 
2.23.0

