Skip to content

Commit

Permalink
Don't error on missing object
Browse files Browse the repository at this point in the history
  • Loading branch information
leg100 committed Jan 24, 2021
1 parent 5088107 commit 1edd2dc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/controllers/workspace_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,11 @@ func (r *WorkspaceReconciler) restore(ctx context.Context, ws *v1alpha1.Workspac
// Try to retrieve existing backup
oh := bh.Object(ws.BackupObjectName())
_, err = oh.Attrs(ctx)
if err != nil {
return r.handleStorageError(err, ws, "RestoreError")
if err == storage.ErrObjectNotExist {
r.recorder.Eventf(ws, "Normal", "RestoreSkipped", "There is no state to restore")
return nil, nil
} else if err != nil {
return nil, err
}

oreader, err := oh.NewReader(ctx)
Expand Down

0 comments on commit 1edd2dc

Please sign in to comment.