Skip to content

Commit ec44a7e

Browse files
authored
Merge pull request #855 from jhowardmsft/hooks
Hooks to linux,solaris and doc clarification
2 parents 09404ad + 28e8f68 commit ec44a7e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

config.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ Runtime implementations MAY support any valid values for platform-specific field
364364

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

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

369370
* **`hooks`** (object, OPTIONAL) MAY contain any of the following properties:
370371
* **`prestart`** (array of objects, OPTIONAL) is an array of [pre-start hooks](#prestart).

specs-go/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type Spec struct {
1717
// Mounts configures additional mounts (on top of Root).
1818
Mounts []Mount `json:"mounts,omitempty"`
1919
// Hooks configures callbacks for container lifecycle events.
20-
Hooks *Hooks `json:"hooks,omitempty"`
20+
Hooks *Hooks `json:"hooks,omitempty" platform:"linux,solaris"`
2121
// Annotations contains arbitrary metadata for the container.
2222
Annotations map[string]string `json:"annotations,omitempty"`
2323

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

0 commit comments

Comments
 (0)