Skip to content

Commit

Permalink
hooks: start with pre-start and post-stop hooks.
Browse files Browse the repository at this point in the history
Signed-off-by: Mrunal Patel <[email protected]>
  • Loading branch information
mrunalp committed Jun 30, 2015
1 parent 25e30fe commit 63d2911
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,20 @@ Runs a process in a container. Can be invoked several times.
Not sure we need that from oc cli. Process is killed from the outside.

This event needs to be captured by oc to run onstop event handlers.

## Hooks
Hooks allows one to run code before/after various lifecycle events of the container. The state of the container is passed to the hooks over a well-known fd, so the hooks could get the information they need to do their work.

### Pre-start
The pre-start hook is called before the container process is started. It provides an opportunity to customize the container. In Linux, for e.g., the network namespace could be configured in this hook.

### Post-stop
The post-stop hook is called after the container process is stopped. Cleanup or debugging could be performed in such a hook.

```
"hooks" : {
"pre-start": ["/path/to/pre-start-hook", "arg1", "arg2"],
"post-stop": ["/path/to/post-stop-hook", "arg1"]
}
```

0 comments on commit 63d2911

Please sign in to comment.