When creating backup
- TODO:
When restoring
During volumesnapshots.snapshot.storage.k8s.io restoreItemAction when VOLUME_SNAPSHOT_MOVER
Env is true
We wait for VolumeSnapshot.spec.Source.PersistentVolumeClaimName
to be populated
- this is populated by volsync I think. We get VolumeSnapshotRestoreList using restoreName, PVC.Name.
- The list option used to get this list is
VSRListOptions := client.MatchingLabels(map[string]string{ velerov1api.RestoreNameLabel: restoreName, PersistentVolumeClaimLabel: PVCName, })
- When this list is returned, we assume the first volumeSnapshotRestore in the list is the one meant for this restore.
if len(vsrList.Items) > 0 {
snapHandle = vsrList.Items[0].Status.SnapshotHandle
} else {
- If more than one VSR in the cluster has this label (failed cleanup etc.), we're screwed.
- Try restore using different name
- Try removing VolumeSnapshotRestore objects in the cluster prior to creating a new restore.