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

kubevirt / containerized-data-importer / #6264
50%
main: 51%

Build:
Build:
LAST BUILD BRANCH: cleanup-prometheus-resources-on-crd-removal
DEFAULT BRANCH: main
Ran 24 Sep 2026 09:04AM UTC
Jobs 1
Files 159
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

23 Sep 2026 04:01PM UTC coverage: 49.862% (+0.05%) from 49.812%
#6264

Pull #4293

travis-ci

pujitha24
Fix leftover importer pod blocking PVC deletion after a failed cleanup

If the importer pod delete in updatePvcFromPod fails once after a
successful import, the error is returned and the reconcile is
requeued. On that requeue shouldReconcilePVC returns false because the
PVC is already marked Succeeded, so Reconcile returns early and never
retries the pod delete. The "PVC being terminated, delete pods" branch
in reconcilePvc sits behind that same early-return check, so it never
runs either, even once the PVC is deleted later. The leftover pod
keeps a controller owner reference to the PVC and Kubernetes'
pvc-protection controller treats any pod naming the PVC as a user
regardless of phase, so the PVC's pvc-protection finalizer is never
cleared and the PVC hangs in Terminating indefinitely.

Skip the early return in Reconcile for PVCs CDI actually manages (has
the import AnnEndpoint/AnnSource annotations) while they are being
deleted, so reconcilePvc's existing terminating-PVC cleanup branch can
run even when the PVC was already marked complete. The gate stays
scoped to CDI import PVCs so unrelated terminating PVCs this
controller merely watches are unaffected.

Validation: go build ./pkg/controller/... and go vet ./pkg/controller/...
are clean; go test ./pkg/controller/ -run TestController passes (374
specs). Added a regression test that fails against the unpatched code
(leftover pod never deleted) and passes with the fix, plus a test
confirming unrelated terminating PVCs without CDI import annotations
still take the original early-return path unchanged. gofmt -l on the
changed files is clean. Could not run this repo's pinned golangci-lint
end to end here: it fails with widespread typecheck errors across many
pre-existing files unrelated to this change, reproducing identically
against the unmodified tree, which points to a local go.work vendor
sync issue in this environment rather than a problem with this diff.

Report: https://github.com/kubevirt/conta... (continued)
Pull Request #4293: Fix leftover importer pod blocking PVC deletion after a failed cleanup

7 of 11 new or added lines in 1 file covered. (63.64%)

162 existing lines in 1 file now uncovered.

15227 of 30538 relevant lines covered (49.86%)

0.56 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
71.6
0.2% pkg/controller/import-controller.go

Coverage Regressions

Lines Coverage ∆ File
162
71.6
0.2% pkg/controller/import-controller.go
Jobs
ID Job ID Ran Files Coverage
1 #6264.1 24 Sep 2026 09:04AM UTC 159
49.86
Source Files on build #6264
  • Tree
  • List 159
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #4293
  • 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