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:
Gilbert Gilb's 2023-03-12 10:07:24 +01:00 committed by GitHub
parent 6ace7bd0dd
commit bbbe04119c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 13 deletions

View file

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