Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add poststart hooks #392

Merged
merged 2 commits into from
Nov 13, 2015
Merged

Add poststart hooks #392

merged 2 commits into from
Nov 13, 2015

Conversation

mrunalp
Copy link
Contributor

@mrunalp mrunalp commented Nov 6, 2015

Integrate poststart hooks from the OCI spec.

Signed-off-by: Mrunal Patel mrunalp@gmail.com

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
* Call poststart hooks after the container is started
* Tie in with spec configuration

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
@mrunalp
Copy link
Contributor Author

mrunalp commented Nov 10, 2015

@LK4D4 @crosbymichael ping

@LK4D4
Copy link
Contributor

LK4D4 commented Nov 10, 2015

LGTM

1 similar comment
@crosbymichael
Copy link
Member

LGTM

crosbymichael added a commit that referenced this pull request Nov 13, 2015
@crosbymichael crosbymichael merged commit 2be14dc into opencontainers:master Nov 13, 2015
stefanberger pushed a commit to stefanberger/runc that referenced this pull request Sep 8, 2017
kolyshkin added a commit to kolyshkin/runtime-spec that referenced this pull request Jul 17, 2024
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 opencontainers#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants