fix: emit event and log when ImageCatalog retrieval fails by armru · Pull Request #9266 · cloudnative-pg/cloudnative-pg

@dosubot dosubot bot added the size:M

This PR changes 30-99 lines, ignoring generated files.

label

Nov 20, 2025

@dosubot dosubot bot added the lgtm

This PR has been approved by a maintainer

label

Nov 20, 2025

@armru @jbattiato

Previously, if the ImageCatalog CRD was missing or another error occurred
during retrieval (other than NotFound), the controller would fail silently
without emitting a Kubernetes event. This made troubleshooting difficult,
especially when using tools like ArgoCD.

This commit ensures that a Warning event and a log is emitted when the ImageCatalog
cannot be retrieved for any reason, providing better visibility into configuration errors.

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>

@jbattiato

Signed-off-by: Jonathan Battiato <jonathan.battiato@enterprisedb.com>

jbattiato

cnpg-bot pushed a commit that referenced this pull request

Nov 25, 2025
Previously we emitted error and logs only for the errors of NotFound
category, for the other types the the controller would fail silently
without emitting a Kubernetes event. This made troubleshooting
difficult, especially when using tools like ArgoCD.

This commit ensures that a Warning event and a log is emitted when the
ImageCatalog cannot be retrieved for any reason, providing better
visibility into configuration errors.

Closes #9016

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Jonathan Battiato <jonathan.battiato@enterprisedb.com>
Co-authored-by: Jonathan Battiato <jonathan.battiato@enterprisedb.com>
(cherry picked from commit 9a354b8)