Skip to content

Commit a5f88db

Browse files
committed
Add prestart/poststop hooks to the spec
Signed-off-by: Mrunal Patel <[email protected]>
1 parent 8e319e1 commit a5f88db

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spec.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ type Spec struct {
1515
Hostname string `json:"hostname"`
1616
// Mounts profile configuration for adding mounts to the container's filesystem.
1717
Mounts []Mount `json:"mounts"`
18+
// Prestart is a list of commands to be run before the container process is executed.
19+
Prestart []Command `json:"prestart"`
20+
// Poststop is a list of commands to be run after the container process exits.
21+
Poststop []Command `json:"poststop"`
1822
}
1923

2024
// Mount specifies a mount for a container.
@@ -61,3 +65,10 @@ type Platform struct {
6165
// Arch is the architecture
6266
Arch string `json:"arch"`
6367
}
68+
69+
type Command struct {
70+
Path string `json:"path"`
71+
Args []string `json:"args"`
72+
Env []string `json:"env"`
73+
Dir string `json:"dir"`
74+
}

0 commit comments

Comments
 (0)