mirror of
https://github.com/containrrr/watchtower.git
synced 2026-02-18 13:18:08 +01:00
Add no-pull label for containers
This commit is contained in:
parent
9cee9e02d0
commit
18e95081bc
3 changed files with 30 additions and 13 deletions
|
|
@ -124,6 +124,22 @@ func (c Container) IsMonitorOnly() bool {
|
|||
return parsedBool
|
||||
}
|
||||
|
||||
// IsNoPull returns the value of the no-pull label. If the label is not set
|
||||
// then false is returned.
|
||||
func (c Container) IsNoPull() bool {
|
||||
rawBool, ok := c.getLabelValue(noPullLabel)
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
|
||||
parsedBool, err := strconv.ParseBool(rawBool)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return parsedBool
|
||||
}
|
||||
|
||||
// Scope returns the value of the scope UID label and if the label
|
||||
// was set.
|
||||
func (c Container) Scope() (string, bool) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue