Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2023-06-15 13:33:58 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2023-06-16 15:14:31 +0300
commit712726622f0d2abcf31ac0d40f57014cc915cc7c (patch)
tree9eda5529bbfaf0c1a2075aeb04c0a0be083f4e0b /internal/praefect/reconciler
parentb5143ac3583b79a242fd25ff0e73a6a7a48fd5a2 (diff)
praefect/coordinator: Untangle NotFound errors from storage layer
The datastore is reusing errors from the storage layer even though these are conceptually orthogonal to each other. Furthermore, given that we sometimes don't have the storage name and relative path available but just the repository ID, we need to use different error types depending on the callsite. Refactor the package to instead use its own ErrRepositoryNotFound error. This also allows us to get rid of the `RepositoryNotFoundError` type, where we instead inject error code and metadata in a central place in the coordinator given that it has more context.
Diffstat (limited to 'internal/praefect/reconciler')
-rw-r--r--internal/praefect/reconciler/reconciler_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/praefect/reconciler/reconciler_test.go b/internal/praefect/reconciler/reconciler_test.go
index f421df15e..4cfcc3a80 100644
--- a/internal/praefect/reconciler/reconciler_test.go
+++ b/internal/praefect/reconciler/reconciler_test.go
@@ -1041,7 +1041,7 @@ func TestReconciler(t *testing.T) {
var err error
existing.Job.RepositoryID, err = rs.GetRepositoryID(ctx, existing.Job.VirtualStorage, existing.Job.RelativePath)
if err != nil {
- require.Equal(t, storage.NewRepositoryNotFoundError(existing.Job.VirtualStorage, existing.Job.RelativePath), err)
+ require.Equal(t, datastore.ErrRepositoryNotFound, err)
}
var id int64