mirror of
https://github.com/containrrr/watchtower.git
synced 2026-02-10 01:14:20 +01:00
add pre/post update check lifecycle hooks
This commit is contained in:
parent
5a6b63a5c7
commit
36b8994933
2 changed files with 64 additions and 0 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