Skip to content

Conversation

@pruthvitd
Copy link
Member

@pruthvitd pruthvitd commented Oct 28, 2025

This PR introduces validation logic to ensure that the kubevirt-velero-plugin is properly enabled and configured in the Velero deployment for Disaster Recovery (DR) protection of VirtualMachines using the internal recipe vm-recipe. The plugin is essential for enabling backup and restore operations for KubeVirt-managed VirtualMachines (VMs), DataVolumes (DVs), PersistentVolumeClaims (PVCs), and associated resources.

Key changes:

  1. Added checks to confirm that the kubevirt-velero-plugin is present and correctly configured in Velero.
  2. Introduced unit tests to validate the correctness of the new logic.
  3. Added a new test rule in the Makefile to run tests specific to the vm-recipe.

Fixes: 2313

@pruthvitd pruthvitd force-pushed the validate-kubevirt-plugin branch from 6c8ac7a to cffbd42 Compare October 28, 2025 18:39
@pruthvitd pruthvitd requested a review from ELENAGER October 28, 2025 18:39
@pruthvitd pruthvitd force-pushed the validate-kubevirt-plugin branch 4 times, most recently from bf0c9e0 to 1a53e5e Compare October 29, 2025 14:51
@pruthvitd pruthvitd force-pushed the validate-kubevirt-plugin branch from 1a53e5e to f7846dc Compare November 5, 2025 13:08
Copy link
Member

@raaizik raaizik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's my review.
Some more comments:

  • It would be good to include some unit tests for the new validation logic — for example, verifying that isKubeVirtEnabled() correctly detects the plugin when present or missing, and that recipeVMBackupValidate() behaves accordingly. This would help catch regressions early.
  • Is there already documentation in the codebase that covers the requirement for Velero and the kubevirt-velero-plugin when protecting VM resources? If not, it might be worth adding or referencing it in a follow-up PR to make this dependency clearer to users.

@pruthvitd pruthvitd force-pushed the validate-kubevirt-plugin branch 2 times, most recently from accaaf6 to 9b178ce Compare November 10, 2025 18:00
@pruthvitd pruthvitd requested a review from raaizik November 10, 2025 18:01
@raaizik
Copy link
Member

raaizik commented Nov 10, 2025

Small nit. Other than that LGTM.

@pruthvitd pruthvitd force-pushed the validate-kubevirt-plugin branch from 9b178ce to 6ad6d73 Compare November 10, 2025 18:38
@pruthvitd pruthvitd requested a review from raaizik November 11, 2025 04:07
@pruthvitd pruthvitd force-pushed the validate-kubevirt-plugin branch 3 times, most recently from 8d93e3a to 7b0121e Compare November 11, 2025 14:56
@pruthvitd pruthvitd marked this pull request as draft November 11, 2025 15:33
@pruthvitd pruthvitd force-pushed the validate-kubevirt-plugin branch from 7b0121e to 814c77a Compare November 12, 2025 00:08
@pruthvitd pruthvitd marked this pull request as ready for review November 12, 2025 00:09
@pruthvitd pruthvitd force-pushed the validate-kubevirt-plugin branch 7 times, most recently from 286c806 to 4e99673 Compare November 12, 2025 14:39
@pruthvitd pruthvitd force-pushed the validate-kubevirt-plugin branch 4 times, most recently from 2bfa44f to 58b5294 Compare November 13, 2025 08:20
if err := recipeVMBackupValidate(ctx, reader, recipeElements, vrg, ramenConfig, log); err != nil {
return recipeElements, fmt.Errorf("recipe %v VM backup validation error: %w", recipeNamespacedName.String(), err)
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this call should happen within RecipeElementsGet. Please move the call outside to the place where you already have the recipe elements.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@pruthvitd pruthvitd force-pushed the validate-kubevirt-plugin branch from 58b5294 to f99e9bb Compare November 26, 2025 06:39
@pruthvitd pruthvitd force-pushed the validate-kubevirt-plugin branch 7 times, most recently from 2d436cf to aa2f8e1 Compare December 2, 2025 15:18
This update introduces validation logic to ensure that the kubevirt-velero-plugin
is properly enabled and configured within the Velero deployment for DR protection
of VirtualMachines using the internal recipe `vm-recipe`. The plugin is essential
for enabling backup and restore operations for KubeVirt-managed VirtualMachines (VMs),
DataVolumes (DVs), PersistentVolumeClaims (PVCs), and associated resources.

Includes unit tests to verify the correctness of the validation logic.

Signed-off-by: pruthvitd <[email protected]>
@pruthvitd pruthvitd force-pushed the validate-kubevirt-plugin branch from aa2f8e1 to 9dc09fc Compare December 2, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Protect VMs Using VM-Recipe Protection

3 participants