mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-13 03:24:39 +00:00
Two defects in the CSI snapshot exposer, both of which make every CBT incremental silently degrade to a full backup on non-vSphere drivers. 1. getCBTInfo read the changeID from the freshly-created backup VSC's status, which is populated asynchronously and is therefore usually empty at that point. The handle is already present in the spec, so fall back to vsc.Spec.Source.SnapshotHandle. vSphere is unaffected -- it takes the VSphereCNSChangeIDAnno branch and never reads the VSC handle -- so this affects every other CSI driver. 2. createBackupVSC hardcoded DeletionPolicy: Delete, so the physical snapshot was removed when the backup completed. Case-2 storage such as Ceph RBD requires the base snapshot to survive for the next GetMetadataDelta call, and the block-data-mover design specifies a RetainSnapshot volume-policy parameter that was never implemented. Inherit the source snapshot class's deletion policy instead, and clean up the backup VSC object in CleanUp. Adds TestCreateBackupVSCDeletionPolicy covering both Delete and Retain. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com> (cherry picked from commit f4867d0489788ce0c7a63ffe08da4ad059db88b4) Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>