Commit c6b3b08
committed
runtime: fail when a poststart hook fails
Poststart hooks exist in runc since 2015 [1], and since that time until
today, if a hook returned an error, runc kills the container.
In 2020, commit c166268 (PR #1008) added the following text
(which became part of runtime-spec release v1.0.2):
> 9. The `poststart` 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.
Now, this text conflicted with the pre-existing runtime (runc) behavior,
and it still conflicts with the current runc behavior.
At this point, we can either fix runtimes or the spec.
To my mind, fixing the spec is a better approach, because:
- initial implementation predates the spec wording by a few years;
- the wording in the spec was never implemented (in runc);
- returning an error (and stopping the container) seems like a more
versatile approach, since a hook can usually choose whether to
return an error or not.
[1]: opencontainers/runc#392
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>1 parent 7017384 commit c6b3b08
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
0 commit comments