Skip to content

fix: emit event and log when ImageCatalog retrieval fails#9266

Merged
mnencia merged 2 commits intomainfrom
dev/9016
Nov 25, 2025
Merged

fix: emit event and log when ImageCatalog retrieval fails#9266
mnencia merged 2 commits intomainfrom
dev/9016

Conversation

@armru
Copy link
Member

@armru armru commented Nov 20, 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

@armru armru requested a review from a team as a code owner November 20, 2025 10:15
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 20, 2025
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.26 release-1.27 labels Nov 20, 2025
@github-actions
Copy link
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@dosubot dosubot bot added the bug 🐛 Something isn't working label Nov 20, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 20, 2025
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>
Signed-off-by: Jonathan Battiato <jonathan.battiato@enterprisedb.com>
@mnencia
Copy link
Member

mnencia commented Nov 25, 2025

/test

@github-actions
Copy link
Contributor

@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/19666506912

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Nov 25, 2025
@mnencia mnencia merged commit 9a354b8 into main Nov 25, 2025
58 of 60 checks passed
@mnencia mnencia deleted the dev/9016 branch November 25, 2025 16:45
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases bug 🐛 Something isn't working lgtm This PR has been approved by a maintainer ok to merge 👌 This PR can be merged release-1.27 size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: No logs if cluster is configured to use ImageCatalog but no CRD for ImageCatalog is supplied

4 participants