mirror of
https://github.com/containers/podman.git
synced 2025-06-21 01:19:15 +08:00
Merge pull request #5776 from vrothberg/au
auto update: skip non-image policies
This commit is contained in:
@ -201,18 +201,25 @@ func imageContainersMap(runtime *libpod.Runtime) (map[string][]*libpod.Container
|
|||||||
if state != define.ContainerStateRunning {
|
if state != define.ContainerStateRunning {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only update containers with the specific label/policy set.
|
// Only update containers with the specific label/policy set.
|
||||||
labels := ctr.Labels()
|
labels := ctr.Labels()
|
||||||
if value, exists := labels[Label]; exists {
|
value, exists := labels[Label]
|
||||||
|
if !exists {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
policy, err := LookupPolicy(value)
|
policy, err := LookupPolicy(value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errors = append(errors, err)
|
errors = append(errors, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip non-image labels (could be explicitly disabled).
|
||||||
if policy != PolicyNewImage {
|
if policy != PolicyNewImage {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Now we know that `ctr` is configured for auto updates.
|
// Now we know that `ctr` is configured for auto updates.
|
||||||
id, _ := ctr.Image()
|
id, _ := ctr.Image()
|
||||||
imageMap[id] = append(imageMap[id], allContainers[i])
|
imageMap[id] = append(imageMap[id], allContainers[i])
|
||||||
|
Reference in New Issue
Block a user