From 279fe72ff8d89527774feca454ec991a09675f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E8=BE=B0=E6=99=94=20=28Liang=20Chenye=29?= Date: Tue, 8 Sep 2015 09:34:30 +0800 Subject: [PATCH 1/2] Update runtime.md --- runtime.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtime.md b/runtime.md index 2120f08f0..e95dcc6c8 100644 --- a/runtime.md +++ b/runtime.md @@ -56,10 +56,15 @@ The pre-start hooks are called after the container process is spawned, but befor They are called after the container namespaces are created on Linux, so they provide an opportunity to customize the container. In Linux, for e.g., the network namespace could be configured in this hook. +The hooks MUST be called in the listed order (`Prestart[0]` first, `Prestart[1]` second, …). If a hook returns a non-zero exit code, then an error including the exit code and the stderr is returned to the caller and the container is torn down. + + ### Post-stop The post-stop hooks are called after the container process is stopped. Cleanup or debugging could be performed in such a hook. + +The hooks MUST be called in the listed order (`Poststop[0]` first, `Poststop[1]` second, …). If a hook returns a non-zero exit code, then an error is logged and the remaining hooks are executed. *Example* From cc9b00f99ee8455ed2b6bd323f85c6cd4686ac9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E8=BE=B0=E6=99=94=20=28Liang=20Chenye=29?= Date: Tue, 8 Sep 2015 11:32:48 +0800 Subject: [PATCH 2/2] Add explicit explanation of the hooks order Add an explicit explanation of the hooks order. Signed-off-by: Liang Chenye --- runtime.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/runtime.md b/runtime.md index e95dcc6c8..b6e5f19a7 100644 --- a/runtime.md +++ b/runtime.md @@ -56,15 +56,13 @@ The pre-start hooks are called after the container process is spawned, but befor They are called after the container namespaces are created on Linux, so they provide an opportunity to customize the container. In Linux, for e.g., the network namespace could be configured in this hook. -The hooks MUST be called in the listed order (`Prestart[0]` first, `Prestart[1]` second, …). +The hooks MUST be called in the listed order (`prestart[0]` first, `prestart[1]` second, …). If a hook returns a non-zero exit code, then an error including the exit code and the stderr is returned to the caller and the container is torn down. - - ### Post-stop The post-stop hooks are called after the container process is stopped. Cleanup or debugging could be performed in such a hook. -The hooks MUST be called in the listed order (`Poststop[0]` first, `Poststop[1]` second, …). +The hooks MUST be called in the listed order (`poststop[0]` first, `poststop[1]` second, …). If a hook returns a non-zero exit code, then an error is logged and the remaining hooks are executed. *Example*