Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@FrankYang0529
Copy link
Member

@FrankYang0529 FrankYang0529 commented Oct 1, 2025

Problem:

Solution:

Related Issue(s):

#6126

Test plan:

New cluster

  1. Check backup/snapshot and restore can work (via kubectl and api).
  2. Check when restoring in progress, delete related vmbackup. In this case, webhook should return error.
  3. Check scheduled backup can work.

Upgrade path

  1. Create a v1.6.0 cluster.
  2. Create VM and backup and restored VM.
  3. Upgrade to this branch.
  4. Check backup still can work.

Cross-cluster VM Backup discovery between old and new Harvester versions:

  • Cluster1 (v1.7) creates a new VM Backup → Cluster2 (v1.6) discovers and restores it
  • Cluster2 (v1.6) creates a new VM Backup → Cluster1 (v1.7) discovers and restores it

Additional documentation or context

Copy link
Member

@WebberHuang1118 WebberHuang1118 left a comment

Choose a reason for hiding this comment

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

LGTM for the source code changes — just a small nit, thanks.

For the test plan, IMO, we might expand it to verify compatibility in the following areas:

  • VM Snapshot creation and restoration

  • Scheduled VM Backup creation and restoration

  • Cross-cluster VM Backup discovery between old and new Harvester versions:

    • Cluster1 (v1.7) creates a new VM Backup → Cluster2 (v1.6) discovers and restores it
    • Cluster2 (v1.6) creates a new VM Backup → Cluster1 (v1.7) discovers and restores it

}

if restore.Status == nil {
if restore.Status.Complete == nil {
Copy link
Member

Choose a reason for hiding this comment

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

Consider factoring this into a separate function.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the review. Addressed all comments.

// We need to delete VolumeSnapshotContent by restore controller, or there will have remaining VolumeSnapshotContent in the system.
func (h *RestoreHandler) RestoreOnRemove(_ string, restore *harvesterv1.VirtualMachineRestore) (*harvesterv1.VirtualMachineRestore, error) {
if restore == nil || restore.Status == nil {
if restore == nil || restore.Status.Complete == nil {
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@WebberHuang1118 WebberHuang1118 self-requested a review October 28, 2025 09:21
Signed-off-by: PoAn Yang <[email protected]>
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.

2 participants