mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-13 21:56:38 +01:00
feat: add no-pull label for containers (#1574)
Co-authored-by: Nedžad Alibegović <nedzad@nedzad.dev> Co-authored-by: nils måsén <nils@piksel.se>
This commit is contained in:
parent
6ace7bd0dd
commit
bbbe04119c
5 changed files with 66 additions and 13 deletions
|
|
@ -125,6 +125,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