• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kubevirt / containerized-data-importer / #6396
51%
main: 51%

Build:
Build:
LAST BUILD BRANCH: cleanup-prometheus-resources-on-crd-removal
DEFAULT BRANCH: main
Ran 26 Nov 2026 08:54AM UTC
Jobs 1
Files 162
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Nov 2026 09:18PM UTC coverage: 51.018% (+0.1%) from 50.918%
#6396

Pull #4371

travis-ci

fasher
operator: order monitoring cleanup and read the PrometheusRule CRD

Detect a missing PrometheusRule API by reading the
prometheusrules.monitoring.coreos.com CRD instead of the
prometheus-cdi-rules object. When the CRD is removed while cdi-operator
runs, the client can keep a cached REST mapping for PrometheusRule. A
Get of prometheus-cdi-rules then returns NotFound, so cdi-operator tried
to recreate the rule and never reached the cleanup.

Delete the service-monitor-cdi ServiceMonitor first. Delete the
cdi-metrics-reader-token Secret and the cdi-monitoring Role and
RoleBinding only after the ServiceMonitor is gone, so a ServiceMonitor
that is still scraped keeps its token and RBAC. If the ServiceMonitor
delete fails, or a finalizer keeps the ServiceMonitor around, the Secret
and RBAC stay until a later reconcile.

Delete each object with the UID and resourceVersion that were just read
as preconditions. An object that is replaced or changes owner between
the read and the delete is not deleted, and the next reconcile reads it
again.

A cleanup failure still emits the DeleteResourceFailed warning and now
logs the error, but it no longer fails the CDI reconcile, so it cannot
hold up an upgrade. The periodic reconcile retries the cleanup.

The create path now makes the Secret and RBAC before the PrometheusRule
and the ServiceMonitor. It still creates the same objects.

Signed-off-by: Asher Frenkel <asher.frenkel@gmail.com>
Pull Request #4371: Delete operator monitoring resources when the PrometheusRule CRD is missing

53 of 55 new or added lines in 2 files covered. (96.36%)

14 existing lines in 1 file now uncovered.

15963 of 31289 relevant lines covered (51.02%)

0.57 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
74.38
3.9% pkg/operator/controller/prometheus.go

Coverage Regressions

Lines Coverage ∆ File
14
74.38
3.9% pkg/operator/controller/prometheus.go
Jobs
ID Job ID Ran Files Coverage
1 #6396.1 26 Nov 2026 08:54AM UTC 162
51.02
Source Files on build #6396
  • Tree
  • List 162
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #4371
  • PR Base - main (#)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc