Add no-pull label for containers

This commit is contained in:
Nedžad Alibegović 2022-10-07 21:30:46 +02:00
parent 9cee9e02d0
commit 18e95081bc
3 changed files with 30 additions and 13 deletions

View file

@ -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) {