mirror of
https://github.com/containrrr/watchtower.git
synced 2026-01-01 14:48:49 +01:00
Use simple string instead of JSON string for pre/post update commands.
This commit is contained in:
parent
25c7853f03
commit
78a375f86e
5 changed files with 26 additions and 88 deletions
|
|
@ -119,34 +119,26 @@ func (c Container) StopSignal() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
// PreUpdateCommandInfo returns the pre-update command set in the container's
|
||||
// PreUpdateCommand returns the pre-update command set in the container's
|
||||
// metadata or an empty string if the user did not set it.
|
||||
func (c Container) PreUpdateCommandInfo() (CommandInfo, error) {
|
||||
func (c Container) PreUpdateCommand() string {
|
||||
if val, ok := c.containerInfo.Config.Labels[preUpdateCommandLabel]; ok {
|
||||
|
||||
commandInfo, err := ReadCommandInfoFromJSON(val)
|
||||
if err != nil {
|
||||
return CommandInfo{}, err
|
||||
}
|
||||
return commandInfo, nil
|
||||
return val
|
||||
}
|
||||
|
||||
return CommandInfo{}, nil
|
||||
return ""
|
||||
}
|
||||
|
||||
// PostUpdateCommandInfo returns the post-update command set in the container's
|
||||
// PostUpdateCommand returns the post-update command set in the container's
|
||||
// metadata or an empty string if the user did not set it.
|
||||
func (c Container) PostUpdateCommandInfo() (CommandInfo, error) {
|
||||
func (c Container) PostUpdateCommand() string {
|
||||
if val, ok := c.containerInfo.Config.Labels[postUpdateCommandLabel]; ok {
|
||||
|
||||
commandInfo, err := ReadCommandInfoFromJSON(val)
|
||||
if err != nil {
|
||||
return CommandInfo{}, err
|
||||
}
|
||||
return commandInfo, nil
|
||||
return val
|
||||
}
|
||||
|
||||
return CommandInfo{}, nil
|
||||
return ""
|
||||
}
|
||||
|
||||
// Ideally, we'd just be able to take the ContainerConfig from the old container
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue