Validate snapshot for restore
@@ -27,6 +27,8 @@ const (
storkSchedulerName = "stork"
// RestoreAnnotation for pvc which has in-place resotre in progress
RestoreAnnotation = annotationPrefix + "restore-in-progress"
+ validateSnapshotTimeout = 1 * time.Minute
+ validateSnapshotRetryTimeout = 5 * time.Second
)
// SnapshotRestoreController controller to watch over In-Place snap restore CRD's
@@ -155,6 +157,12 @@ func (c *SnapshotRestoreController) handleInitial(snapRestore *stork_api.VolumeS
return fmt.Errorf("unable to get get snapshot details %s: %v",
snapName, err)
}
+ if err := k8s.Instance().ValidateSnapshot(snapName,
+ snapNamespace, false,
+ validateSnapshotRetryTimeout,
+ validateSnapshotTimeout); err != nil {
+ return fmt.Errorf("snapshot is not complete %v", err)
+ }
snapshotList = append(snapshotList, snapshot)
}
