diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-06-15 13:33:58 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-06-16 15:14:31 +0300 |
commit | 712726622f0d2abcf31ac0d40f57014cc915cc7c (patch) | |
tree | 9eda5529bbfaf0c1a2075aeb04c0a0be083f4e0b /internal/praefect/reconciler | |
parent | b5143ac3583b79a242fd25ff0e73a6a7a48fd5a2 (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.go | 2 |
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 |