Skip to content

Commit

Permalink
Merge pull request #855 from jhowardmsft/hooks
Browse files Browse the repository at this point in the history
Hooks to linux,solaris and doc clarification
  • Loading branch information
tianon authored May 31, 2017
2 parents 09404ad + 28e8f68 commit ec44a7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion config.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ Runtime implementations MAY support any valid values for platform-specific field

## <a name="configHooks" />Hooks

Hooks allow for the configuration of custom actions related to the [lifecycle](runtime.md#lifecycle) of the container.
Hooks allow for the configuration of custom actions related to the [lifecycle](runtime.md#lifecycle) of the container if supported by the platform.
On Linux, they are run after the container namespaces are created.

* **`hooks`** (object, OPTIONAL) MAY contain any of the following properties:
* **`prestart`** (array of objects, OPTIONAL) is an array of [pre-start hooks](#prestart).
Expand Down
3 changes: 1 addition & 2 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Spec struct {
// Mounts configures additional mounts (on top of Root).
Mounts []Mount `json:"mounts,omitempty"`
// Hooks configures callbacks for container lifecycle events.
Hooks *Hooks `json:"hooks,omitempty"`
Hooks *Hooks `json:"hooks,omitempty" platform:"linux,solaris"`
// Annotations contains arbitrary metadata for the container.
Annotations map[string]string `json:"annotations,omitempty"`

Expand Down Expand Up @@ -134,7 +134,6 @@ type Hook struct {
// Hooks for container setup and teardown
type Hooks struct {
// Prestart is a list of hooks to be run before the container process is executed.
// On Linux, they are run after the container namespaces are created.
Prestart []Hook `json:"prestart,omitempty"`
// Poststart is a list of hooks to be run after the container process is started.
Poststart []Hook `json:"poststart,omitempty"`
Expand Down

0 comments on commit ec44a7e

Please sign in to comment.