Skip to content

Commit

Permalink
Integrate hooks with spec
Browse files Browse the repository at this point in the history
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
  • Loading branch information
mrunalp committed Aug 4, 2015
1 parent ba447f7 commit c533970
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,22 @@ func createLibcontainerConfig(spec *specs.LinuxSpec) (*configs.Config, error) {
for _, m := range spec.Mounts {
config.Mounts = append(config.Mounts, createLibcontainerMount(cwd, m))
}
for _, cmd := range spec.Hooks.Prestart {
c := configs.Command{
Path: cmd.Path,
Args: cmd.Args,
Env: cmd.Env,
}
config.Prestart = append(config.Prestart, c)
}
for _, cmd := range spec.Hooks.Poststop {
c := configs.Command{
Path: cmd.Path,
Args: cmd.Args,
Env: cmd.Env,
}
config.Poststop = append(config.Poststop, c)
}
if err := createDevices(spec, config); err != nil {
return nil, err
}
Expand Down

0 comments on commit c533970

Please sign in to comment.