mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-22 05:40:50 +02:00
add pre/post update check lifecycle hooks (#373)
* add pre/post update check lifecycle hooks * update docs for lifecycle hooks * Fix phrasing
This commit is contained in:
parent
1b3db5ed5d
commit
135467dcf6
3 changed files with 87 additions and 15 deletions
|
@ -5,10 +5,22 @@ const (
|
|||
signalLabel = "com.centurylinklabs.watchtower.stop-signal"
|
||||
enableLabel = "com.centurylinklabs.watchtower.enable"
|
||||
zodiacLabel = "com.centurylinklabs.zodiac.original-image"
|
||||
preCheckLabel = "com.centurylinklabs.watchtower.lifecycle.pre-check"
|
||||
postCheckLabel = "com.centurylinklabs.watchtower.lifecycle.post-check"
|
||||
preUpdateLabel = "com.centurylinklabs.watchtower.lifecycle.pre-update"
|
||||
postUpdateLabel = "com.centurylinklabs.watchtower.lifecycle.post-update"
|
||||
)
|
||||
|
||||
// GetLifecyclePreCheckCommand returns the pre-check command set in the container metadata or an empty string
|
||||
func (c Container) GetLifecyclePreCheckCommand() string {
|
||||
return c.getLabelValueOrEmpty(preCheckLabel)
|
||||
}
|
||||
|
||||
// GetLifecyclePostCheckCommand returns the post-check command set in the container metadata or an empty string
|
||||
func (c Container) GetLifecyclePostCheckCommand() string {
|
||||
return c.getLabelValueOrEmpty(postCheckLabel)
|
||||
}
|
||||
|
||||
// GetLifecyclePreUpdateCommand returns the pre-update command set in the container metadata or an empty string
|
||||
func (c Container) GetLifecyclePreUpdateCommand() string {
|
||||
return c.getLabelValueOrEmpty(preUpdateLabel)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue