Skip to content

fix: recognize VirtualMachineBackup's renamed Complete condition - #208

Merged
openshift-merge-bot[bot] merged 1 commit into
migtools:oadp-devfrom
kaovilai:fix-vmb-condition-complete-rename
Aug 31, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
migtools:oadp-devfrom
kaovilai:fix-vmb-condition-complete-rename

Conversation

@kaovilai

@kaovilai kaovilai commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Reported cross-session from a live nightly-KubeVirt (v1.20.0) e2e run: a fourth, distinct issue found while testing oadp-operator#2404, unrelated to CNV-85377 or the #207 annotation race. Fixes #209.

Root cause

evaluateVMBackupStatus/isVMBTerminal only recognize kubevirtbackupv1alpha1.ConditionDone ("Done"), but virt-controller's CBT backup path renamed that condition type to "Complete" starting with nightly v1.20.0. doneCond stays nil forever against that version, so the controller loops "VirtualMachineBackup in progress, requeuing" until Spec.OperationTimeout -- observed live: 243 repeats of that log line, then a 20-minute context deadline exceeded -- even though vmb.Status.Conditions already has Complete=True, reason=CompletedWithWarning. The backup itself completed fine; the controller just never recognized it.

Fix

Our vendored kubevirt.io/api (v1.8.0-alpha.0) predates the rename and has no ConditionComplete constant, so add it locally as the literal string virt-controller actually emits ("Complete"), and recognize it alongside the existing ConditionDone in both places that scan for it (evaluateVMBackupStatus and isVMBTerminal).

Bumping kubevirt.io/api instead was considered and rejected for this fix: v1.8.0-alpha.0 to whatever version introduced ConditionComplete is a large jump with its own unrelated API-surface risk, whereas accepting both condition names is a minimal, backward- and forward-compatible change.

Test plan (TDD)

New table cases in TestHandleAccepted_VMBStatusDetection and TestIsVMBTerminal pin the exact scenario reported (Complete=True, Reason=CompletedWithWarning) transitioning to Prepared/terminal instead of stalling.

  • go build ./...
  • go vet ./...
  • go test ./...
  • make lint

Note

Responses generated with Claude

Reported cross-session from a live nightly-KubeVirt (v1.20.0) e2e run:
evaluateVMBackupStatus/isVMBTerminal only recognize
kubevirtbackupv1alpha1.ConditionDone ("Done"), but virt-controller's
CBT backup path renamed that condition type to "Complete" starting
with nightly v1.20.0. doneCond stays nil forever against that version,
so the controller loops "VirtualMachineBackup in progress, requeuing"
until Spec.OperationTimeout, even though vmb.Status.Conditions already
has Complete=True (observed live: 243 repeats of that log line, then a
20-minute context deadline exceeded) -- the VMB itself completed fine.

Our vendored kubevirt.io/api (v1.8.0-alpha.0) predates the rename and
has no ConditionComplete constant, so add it locally as the literal
string virt-controller actually emits, and recognize it alongside the
existing ConditionDone in both places that scan for it.

Tests: new table cases in TestHandleAccepted_VMBStatusDetection and
TestIsVMBTerminal pin the exact scenario reported (Complete=True,
Reason=CompletedWithWarning) transitioning to Prepared/terminal
instead of stalling.

Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
@openshift-ci
openshift-ci Bot requested review from sseago and weshayutin August 27, 2026 21:24
@coderabbitai

coderabbitai Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3c68410f-3b3e-4a92-aea0-27356806c85f

📥 Commits

Reviewing files that changed from the base of the PR and between e9fa72d and dd82d57.

📒 Files selected for processing (2)
  • internal/controller/kubevirt_dataupload_controller.go
  • internal/controller/kubevirt_dataupload_controller_test.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The controller now recognizes KubeVirt nightly Complete VMB conditions alongside ConditionDone. Regression tests cover DataUpload preparation and terminal-state detection.

Changes

VMB Complete condition support

Layer / File(s) Summary
Detect Complete during VMB status evaluation
internal/controller/kubevirt_dataupload_controller.go, internal/controller/kubevirt_dataupload_controller_test.go
Defines conditionComplete, matches it during status evaluation, and verifies Complete=True transitions the DataUpload to Prepared.
Detect Complete as terminal
internal/controller/kubevirt_dataupload_controller.go, internal/controller/kubevirt_dataupload_controller_test.go
Matches conditionComplete in terminal-state detection and verifies successful completion.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to dd82d

The controller now recognizes both old and renamed VirtualMachineBackup completion conditions, restoring expected completion handling without changing interfaces or dependencies. No actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: sseago, weshayutin, shubham-pampattiwar

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: recognizing the renamed "Complete" condition for VirtualMachineBackup while implying a bug fix.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Joeavaikath

Copy link
Copy Markdown
Contributor

Bumping kubevirt.io/api instead was considered and rejected for this fix: v1.8.0-alpha.0 to whatever version introduced ConditionComplete is a large jump with its own unrelated API-surface risk, whereas accepting both condition names is a minimal, backward- and forward-compatible change.

Would we be handling periodic bumps + code changes as a long term fix?

@kaovilai

Copy link
Copy Markdown
Member Author

Bumping kubevirt.io/api instead was considered and rejected for this fix: v1.8.0-alpha.0 to whatever version introduced ConditionComplete is a large jump with its own unrelated API-surface risk, whereas accepting both condition names is a minimal, backward- and forward-compatible change.

Would we be handling periodic bumps + code changes as a long term fix?

Yes, always.

kaovilai added a commit to kaovilai/oadp-operator that referenced this pull request Aug 29, 2026
…penshift#212 fix build

Lets the incremental-sequence spec actually validate migtools/kubevirt-datamover-controller#208
and openshift#212 (both unmerged upstream) instead of self-skipping on the known
flake pattern every run. Uses DPA's spec.unsupportedOverrides
(kubevirtDatamoverControllerImageFqin), not a direct Deployment/manifest
patch, so it's a pure e2e-test-time override with no manifest churn.

Remove once openshift#208/openshift#212 merge upstream and a release picks them up.

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
kaovilai added a commit to kaovilai/oadp-operator that referenced this pull request Aug 29, 2026
…two unmerged upstream PRs

Lets the incremental-sequence spec actually validate
migtools/kubevirt-datamover-controller#208 and
migtools/kubevirt-datamover-controller#212 (both
unmerged upstream) instead of self-skipping on the known flake pattern
every run. Uses DPA's spec.unsupportedOverrides
(kubevirtDatamoverControllerImageFqin), not a direct Deployment/manifest
patch, so it's a pure e2e-test-time override with no manifest churn.

Remove once those two PRs merge upstream and a release picks them up.

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
kaovilai added a commit to kaovilai/oadp-operator that referenced this pull request Aug 29, 2026
…d confirmed live

Verified against a real cluster (2026-08-29, AWS amd64) with the
combined-208-212-test override image: the incremental-sequence spec ran
to a genuine PASS in 7m20s with zero occurrences of either pattern's
string in the whole run's logs -- previously this spec reliably
flake-skipped within ~20 minutes on one or both patterns. See
migtools/kubevirt-datamover-controller#208 and
migtools/kubevirt-datamover-controller#212.

Drops the two now-dead FlakePattern entries and the CheckIfFlakeOccurred-
level tests that specifically exercised them; keeps the
FilterLogLinesContaining-level tests and their real captured fixture
data, which remain valid regardless of the pattern registry's contents.

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@kaovilai

kaovilai commented Aug 29, 2026 •

Copy link
Copy Markdown
Member Author

Live end-to-end validation confirmed (cross-session): the combined test image (this fix + #212) ran the incremental-sequence spec against a real cluster on nightly KubeVirt -- passed clean in 7m20s, with zero occurrences of the previously-triggering log pattern (this spec used to hit the stuck "VirtualMachineBackup in progress, requeuing" loop and skip within 20 minutes every time before this fix). A separate, unrelated known issue (CNV-85377) surfaced once mid-run but didn't block success.

The now-obsolete flake-pattern workaround for this bug has been removed from oadp-operator's e2e suite (openshift/oadp-operator#2404).

Note

Responses generated with Claude

kaovilai added a commit to kaovilai/oadp-operator that referenced this pull request Aug 29, 2026
…s warning

RunMustGather's check treated ANY content in the must-gather summary's
"## Errors" section as a hard failure. The summary generator flags any DPA
using spec.unsupportedOverrides at all as a warning, regardless of key or
reason, since that field is inherently "unsupported" -- purely
informational, not an actual problem.

This broke live: adding a single test-time kdm-controller image override
to the shared dpaCR (for validating
migtools/kubevirt-datamover-controller#208 and
migtools/kubevirt-datamover-controller#212 before
they merge) made every e2e job's must-gather check fail, including
completely unrelated CLI suites -- confirmed on
ci/prow/5.0-e2e-test-cli-aws and ci/prow/5.1-e2e-test-cli-aws.

Now tolerates that one specific, expected warning line while still failing
on any other content in the Errors section. Verified against the real
captured summary text from the failing 5.1-e2e-test-cli-aws run.

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
@kaovilai

Copy link
Copy Markdown
Member Author

/cherry-pick oadp-1.6

@openshift-cherrypick-robot

Copy link
Copy Markdown

@kaovilai: once the present PR merges, I will cherry-pick it on top of oadp-1.6 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick oadp-1.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci

openshift-ci Bot commented Aug 31, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Joeavaikath, kaovilai, shubham-pampattiwar, sseago

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [kaovilai,shubham-pampattiwar,sseago]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sseago

sseago commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Aug 31, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit 88155e5 into migtools:oadp-dev Aug 31, 2026
7 checks passed
@openshift-cherrypick-robot

Copy link
Copy Markdown

@kaovilai: new pull request created: #215

Details

In response to this:

/cherry-pick oadp-1.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

openshift-merge-bot Bot pushed a commit to openshift/oadp-operator that referenced this pull request Sep 2, 2026
…two unmerged upstream PRs

Lets the incremental-sequence spec actually validate
migtools/kubevirt-datamover-controller#208 and
migtools/kubevirt-datamover-controller#212 (both
unmerged upstream) instead of self-skipping on the known flake pattern
every run. Uses DPA's spec.unsupportedOverrides
(kubevirtDatamoverControllerImageFqin), not a direct Deployment/manifest
patch, so it's a pure e2e-test-time override with no manifest churn.

Remove once those two PRs merge upstream and a release picks them up.

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
openshift-merge-bot Bot pushed a commit to openshift/oadp-operator that referenced this pull request Sep 2, 2026
Verified against a real cluster (2026-08-29, AWS amd64) with the
combined-208-212-test override image: the incremental-sequence spec ran
to a genuine PASS in 7m20s with zero occurrences of either pattern's
string in the whole run's logs -- previously this spec reliably
flake-skipped within ~20 minutes on one or both patterns. See
migtools/kubevirt-datamover-controller#208 and
migtools/kubevirt-datamover-controller#212.

Drops the two now-dead FlakePattern entries and the CheckIfFlakeOccurred-
level tests that specifically exercised them; keeps the
FilterLogLinesContaining-level tests and their real captured fixture
data, which remain valid regardless of the pattern registry's contents.

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
openshift-merge-bot Bot pushed a commit to openshift/oadp-operator that referenced this pull request Sep 2, 2026
…s warning

RunMustGather's check treated ANY content in the must-gather summary's
"## Errors" section as a hard failure. The summary generator flags any DPA
using spec.unsupportedOverrides at all as a warning, regardless of key or
reason, since that field is inherently "unsupported" -- purely
informational, not an actual problem.

This broke live: adding a single test-time kdm-controller image override
to the shared dpaCR (for validating
migtools/kubevirt-datamover-controller#208 and
migtools/kubevirt-datamover-controller#212 before
they merge) made every e2e job's must-gather check fail, including
completely unrelated CLI suites -- confirmed on
ci/prow/5.0-e2e-test-cli-aws and ci/prow/5.1-e2e-test-cli-aws.

Now tolerates that one specific, expected warning line while still failing
on any other content in the Errors section. Verified against the real
captured summary text from the failing 5.1-e2e-test-cli-aws run.

Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataUpload stuck 'in progress' forever: VirtualMachineBackup condition types out of sync with kubevirt.io/api

5 participants