auto-update: return errors when checking for updates

When checking for new images on registries, do not suppress
and debug-log errors but return them.  Other images and units
will still be processed.

That is important to a) stop hiding flaky registries (see #18321)
                     b) mark the updates as `failed` instead of `false`

[NO NEW TESTS NEEDED]

Closes: #18321
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg 2023-04-25 10:52:52 +02:00
parent 191892419f
commit 0e955bec74
1 changed files with 1 additions and 10 deletions

View File

@ -249,16 +249,7 @@ func (t *task) report() *entities.AutoUpdateReport {
func (t *task) updateAvailable(ctx context.Context) (bool, error) {
switch t.policy {
case PolicyRegistryImage:
// Errors checking for updates only should not be fatal.
// Especially on Edge systems, connection may be limited or
// there may just be a temporary downtime of the registry.
// But make sure to leave some breadcrumbs in the debug logs
// such that potential issues _can_ be analyzed if needed.
available, err := t.registryUpdateAvailable(ctx)
if err != nil {
logrus.Debugf("Error checking updates for image %s: %v (ignoring error)", t.rawImageName, err)
}
return available, nil
return t.registryUpdateAvailable(ctx)
case PolicyLocalImage:
return t.localUpdateAvailable()
default: