diff --git a/pkg/controllers/restoresession_controller.go b/pkg/controllers/restoresession_controller.go index 62088d3..1cb3e54 100644 --- a/pkg/controllers/restoresession_controller.go +++ b/pkg/controllers/restoresession_controller.go @@ -28,7 +28,7 @@ type RestoreSessionReconciler struct { } func (r *RestoreSessionReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { - time.Sleep(2 * time.Second) + time.Sleep(300 * time.Millisecond) ctx := context.Background() log := r.Log.WithValues("restoresession", req.NamespacedName) r.RestoreSession = &formolv1alpha1.RestoreSession{} @@ -83,6 +83,7 @@ func (r *RestoreSessionReconciler) Reconcile(req ctrl.Request) (ctrl.Result, err return ctrl.Result{}, err } url := fmt.Sprintf("s3:http://%s/%s/%s-%s", repo.Spec.Backend.S3.Server, repo.Spec.Backend.S3.Bucket, strings.ToUpper(r.BackupConf.Namespace), strings.ToLower(r.BackupConf.Name)) + log.V(0).Info("restoring", "url", url, "snapshot", r.BackupSession.Status.Targets[i].SnapshotId) output, err := restic.RestorePaths(url, r.BackupSession.Status.Targets[i].SnapshotId) if err != nil { log.Error(err, "unable to restore deployment", "output", string(output)) diff --git a/pkg/restic/root.go b/pkg/restic/root.go index df6aec1..dabd1c1 100644 --- a/pkg/restic/root.go +++ b/pkg/restic/root.go @@ -92,7 +92,9 @@ func RestorePaths(repository string, snapshotId string) ([]byte, error) { return []byte{}, err } cmd := exec.Command(resticExec, "restore", "-r", repository, snapshotId, "--target", "/") - return cmd.CombinedOutput() + output, err := cmd.CombinedOutput() + log.V(1).Info("restic restore output", "output", string(output)) + return output, err } func DeleteSnapshot(snapshot string) error {