Skip to content

Add cross-cluster restore to KubeTaskWith{Backup,Restore}PVC - #4086

Open
anand-veeam wants to merge 4 commits into
anand-veeam/K10-36518-new-long-running-functionfrom
anand-veeam/k10-36928-export-import-functionality-csi-driver
Open

anand-veeam wants to merge 4 commits into
anand-veeam/K10-36518-new-long-running-functionfrom
anand-veeam/k10-36928-export-import-functionality-csi-driver

Conversation

@anand-veeam

@anand-veeam anand-veeam commented Jun 12, 2026 •

Copy link
Copy Markdown

Change Overview

Summary

Adds cross-cluster restore support to KubeTaskWith{Backup,Restore}PVC by
having the backup function emit the CSI snapshot handle and the restore
function reconstruct a bridge VolumeSnapshot + VolumeSnapshotContent on the
dest cluster when the original snapshot doesn't exist locally.

Pattern mirrors K10's CreatePVCandSnapshotFromSource
(kio/exec/internal/phaseutils/phaseutils.go:542): clone the dest
VolumeSnapshotClass with DeletionPolicy: Retain, CreateFromSource using
the clone, defer cleanup of the VS+VSC after the restore pod completes.
Kopia content is preserved because the cloned class carries Retain.

Changes

Backup side (KubeTaskWithBackupPVC)

  • Emit snapshotHandle output by reading
    VolumeSnapshotContent.spec.source.snapshotHandle after the CSI snapshot
    reaches terminal state.
  • Warn-log if the handle can't be read so cross-cluster failures are
    observable at backup time, not at restore time.

Restore side (KubeTaskWithRestorePVC)

  • New optional snapshotHandle arg.
  • Auto-fill volumeSnapshotName, snapshotHandle, restoreSize from the
    input artifact's KeyValue (K10 catalog convention) so the blueprint
    doesn't have to re-template them as args.
  • New ensureRestoreSnapshot step before PVC provisioning:
    • VS exists on dest → noop (same-cluster behavior unchanged)
    • VS missing → clone source VSClass on dest with Retain, CreateFromSource
      using the kopia handle, defer VS+VSC cleanup at end of run().
  • snapshotClassForRestore skips kanister-clone-* classes to avoid
    nested-clone loops on subsequent restores.

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test
  • 🏗️ Build

Issues

  • fixes #issue-number

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@github-actions

Copy link
Copy Markdown
Contributor

This PR is marked as stale due to inactivity. Add a new comment to reactivate it. CC @kanisterio/maintainers

@github-actions github-actions Bot added the stale label Sep 11, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant