mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02:00
feat: add timeout override for pre-update lifecycle hook
This commit is contained in:
parent
7e7d4bf9ce
commit
1d1c630f7a
7 changed files with 89 additions and 24 deletions
|
@ -75,7 +75,6 @@ func stopStaleContainer(container container.Container, client container.Client,
|
|||
}
|
||||
if params.LifecycleHooks {
|
||||
lifecycle.ExecutePreUpdateCommand(client, container)
|
||||
|
||||
}
|
||||
|
||||
if err := client.StopContainer(container, params.Timeout); err != nil {
|
||||
|
@ -140,4 +139,4 @@ func checkDependencies(containers []container.Container) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -30,12 +30,14 @@ func RegisterSystemFlags(rootCmd *cobra.Command) {
|
|||
viper.GetInt("WATCHTOWER_POLL_INTERVAL"),
|
||||
"poll interval (in seconds)")
|
||||
|
||||
flags.StringP("schedule",
|
||||
flags.StringP(
|
||||
"schedule",
|
||||
"s",
|
||||
viper.GetString("WATCHTOWER_SCHEDULE"),
|
||||
"the cron expression which defines when to update")
|
||||
|
||||
flags.DurationP("stop-timeout",
|
||||
flags.DurationP(
|
||||
"stop-timeout",
|
||||
"t",
|
||||
viper.GetDuration("WATCHTOWER_TIMEOUT"),
|
||||
"timeout before a container is forcefully stopped")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue