Skip to content

Commit

Permalink
chore: re-enable prestart hook
Browse files Browse the repository at this point in the history
  • Loading branch information
nixpig committed Dec 6, 2024
1 parent adb2888 commit 2ebc56c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions container/container_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ func (c *Container) Start(log *zerolog.Logger) error {
return fmt.Errorf("dial socket: %w", err)
}

// 'prestart' hook is deprecated and appears to break 'docker run'??
// if err := c.ExecHooks("prestart", log); err != nil {
// // TODO: run DELETE tasks here, then...
// if err := c.ExecHooks("poststop", log); err != nil {
// log.Warn().Err(err).Msg("failed to execute poststop hooks")
// fmt.Println("WARNING: failed to execute poststop hooks")
// }
//
// return fmt.Errorf("failed to run prestart hooks: %w", err)
// }
// FIXME: 'prestart' hook is deprecated and appears to break 'docker run'??
if err := c.ExecHooks("prestart", log); err != nil {
// TODO: run DELETE tasks here, then...
if err := c.ExecHooks("poststop", log); err != nil {
log.Warn().Err(err).Msg("failed to execute poststop hooks")
fmt.Println("WARNING: failed to execute poststop hooks")
}

return fmt.Errorf("failed to run prestart hooks: %w", err)
}

log.Info().Msg("sending start")
if _, err := conn.Write([]byte("start")); err != nil {
Expand Down

0 comments on commit 2ebc56c

Please sign in to comment.