From 2405bc8f3b363df27ef1a07538b0decec7f9897d Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Wed, 19 Apr 2023 16:44:54 +0300 Subject: [PATCH] satellite/metabase: stop using the common error type Updates https://github.com/storj/storj/issues/5291 Change-Id: I7b57a4b454d3619cb5d8ae4cd92f818ad2839c8b --- go.mod | 4 ++-- go.sum | 8 ++++---- satellite/buckets/db.go | 7 ++++--- satellite/metabase/commit.go | 2 +- satellite/metainfo/endpoint_bucket.go | 2 +- testsuite/storjscan/go.mod | 4 ++-- testsuite/storjscan/go.sum | 8 ++++---- testsuite/ui/go.mod | 4 ++-- testsuite/ui/go.sum | 8 ++++---- 9 files changed, 24 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index 28494e591..c79401f68 100644 --- a/go.mod +++ b/go.mod @@ -59,11 +59,11 @@ require ( golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e gopkg.in/segmentio/analytics-go.v3 v3.1.0 gopkg.in/yaml.v3 v3.0.1 - storj.io/common v0.0.0-20230417173225-d1152ea3099a + storj.io/common v0.0.0-20230419134608-0971ce717d0c storj.io/drpc v0.0.33-0.20230417171205-2ca712ef4ab5 storj.io/monkit-jaeger v0.0.0-20220915074555-d100d7589f41 storj.io/private v0.0.0-20230405095015-9e5bbc1c7ca8 - storj.io/uplink v1.10.1-0.20230413192940-d37f89e8219e + storj.io/uplink v1.10.1-0.20230419134602-db8e801a38e4 ) require ( diff --git a/go.sum b/go.sum index 14f2e9cdb..098c2db36 100644 --- a/go.sum +++ b/go.sum @@ -974,8 +974,8 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= storj.io/common v0.0.0-20220719163320-cd2ef8e1b9b0/go.mod h1:mCYV6Ud5+cdbuaxdPD5Zht/HYaIn0sffnnws9ErkrMQ= -storj.io/common v0.0.0-20230417173225-d1152ea3099a h1:B5AVXKsrqcynZdxznewcXU57VARFeRXSDpCmGnNwFtE= -storj.io/common v0.0.0-20230417173225-d1152ea3099a/go.mod h1:j5YdcshmpJL+oW1+3IyBnCsv/HGbFkbzNDtuZg24KF0= +storj.io/common v0.0.0-20230419134608-0971ce717d0c h1:v7SwkKqxtTp4w0tKpqeBu5d/8Dqd0Rxy/L1HT7O0qAY= +storj.io/common v0.0.0-20230419134608-0971ce717d0c/go.mod h1:j5YdcshmpJL+oW1+3IyBnCsv/HGbFkbzNDtuZg24KF0= storj.io/drpc v0.0.32/go.mod h1:6rcOyR/QQkSTX/9L5ZGtlZaE2PtXTTZl8d+ulSeeYEg= storj.io/drpc v0.0.33-0.20230417171205-2ca712ef4ab5 h1:4iOQovjXb6oAMLrjf0Qc4MuRRLd9hXC7+CWqOt+AzCw= storj.io/drpc v0.0.33-0.20230417171205-2ca712ef4ab5/go.mod h1:vR804UNzhBa49NOJ6HeLjd2H3MakC1j5Gv8bsOQT6N4= @@ -985,5 +985,5 @@ storj.io/picobuf v0.0.1 h1:ekEvxSQCbEjTVIi/qxj2za13SJyfRE37yE30IBkZeT0= storj.io/picobuf v0.0.1/go.mod h1:7ZTAMs6VesgTHbbhFU79oQ9hDaJ+MD4uoFQZ1P4SEz0= storj.io/private v0.0.0-20230405095015-9e5bbc1c7ca8 h1:bUSNdChb1E5a/IFAy1l5zq+oZIYR5WPJ1JC71GC12dA= storj.io/private v0.0.0-20230405095015-9e5bbc1c7ca8/go.mod h1:JxBlgPwo+P0OOJDSPJLwBJWUPnhnvrHOlKAN0aV/bhY= -storj.io/uplink v1.10.1-0.20230413192940-d37f89e8219e h1:y6CSddIrAAZ5tSeSLNlXRjo81NT0f4+vEJ5spS2YxuA= -storj.io/uplink v1.10.1-0.20230413192940-d37f89e8219e/go.mod h1:x6XS4VpmVMU2N/VXm7QGS2M4Ar1+FmWa0lZGYfhMCww= +storj.io/uplink v1.10.1-0.20230419134602-db8e801a38e4 h1:OXdKu4nUJiILbD2e2kLCSSpbVPfkCfrBodmOPba0N0E= +storj.io/uplink v1.10.1-0.20230419134602-db8e801a38e4/go.mod h1:Xq9HTfy/mnHm9X44OzRquLnpUMwdxdVnDyAnVTMNkPQ= diff --git a/satellite/buckets/db.go b/satellite/buckets/db.go index 169358e16..9199c61b9 100644 --- a/satellite/buckets/db.go +++ b/satellite/buckets/db.go @@ -10,6 +10,7 @@ import ( "github.com/zeebo/errs" "storj.io/common/macaroon" + "storj.io/common/pb" "storj.io/common/storj" "storj.io/common/uuid" "storj.io/storj/satellite/metabase" @@ -41,13 +42,13 @@ type Bucket struct { } // ListDirection specifies listing direction. -type ListDirection int32 +type ListDirection = pb.ListDirection const ( // DirectionForward lists forwards from cursor, including cursor. - DirectionForward = 1 + DirectionForward = pb.ListDirection_FORWARD // DirectionAfter lists forwards from cursor, without cursor. - DirectionAfter = 2 + DirectionAfter = pb.ListDirection_AFTER ) // MinimalBucket contains minimal bucket fields for metainfo protocol. diff --git a/satellite/metabase/commit.go b/satellite/metabase/commit.go index a354dec5f..c49e33828 100644 --- a/satellite/metabase/commit.go +++ b/satellite/metabase/commit.go @@ -27,7 +27,7 @@ const defaultZombieDeletionPeriod = 24 * time.Hour var ( // ErrObjectNotFound is used to indicate that the object does not exist. - ErrObjectNotFound = storj.ErrObjectNotFound + ErrObjectNotFound = errs.Class("metabase: object not found") // ErrInvalidRequest is used to indicate invalid requests. ErrInvalidRequest = errs.Class("metabase: invalid request") // ErrConflict is used to indicate conflict with the request. diff --git a/satellite/metainfo/endpoint_bucket.go b/satellite/metainfo/endpoint_bucket.go index 74e7e7f66..d1267b5d0 100644 --- a/satellite/metainfo/endpoint_bucket.go +++ b/satellite/metainfo/endpoint_bucket.go @@ -319,7 +319,7 @@ func (endpoint *Endpoint) ListBuckets(ctx context.Context, req *pb.BucketListReq listOpts := buckets.ListOptions{ Cursor: string(req.Cursor), Limit: int(req.Limit), - Direction: buckets.ListDirection(req.Direction), + Direction: req.Direction, } bucketList, err := endpoint.buckets.ListBuckets(ctx, keyInfo.ProjectID, listOpts, allowedBuckets) if err != nil { diff --git a/testsuite/storjscan/go.mod b/testsuite/storjscan/go.mod index 7bcd737bf..b40cdb838 100644 --- a/testsuite/storjscan/go.mod +++ b/testsuite/storjscan/go.mod @@ -9,11 +9,11 @@ require ( github.com/zeebo/errs v1.3.0 go.uber.org/zap v1.21.0 golang.org/x/sync v0.1.0 - storj.io/common v0.0.0-20230417173225-d1152ea3099a + storj.io/common v0.0.0-20230419134608-0971ce717d0c storj.io/private v0.0.0-20230405095015-9e5bbc1c7ca8 storj.io/storj v1.63.1 storj.io/storjscan v0.0.0-20220926140643-1623c3b391b0 - storj.io/uplink v1.10.1-0.20230413192940-d37f89e8219e + storj.io/uplink v1.10.1-0.20230419134602-db8e801a38e4 ) require ( diff --git a/testsuite/storjscan/go.sum b/testsuite/storjscan/go.sum index 7e79217de..2d0376b06 100644 --- a/testsuite/storjscan/go.sum +++ b/testsuite/storjscan/go.sum @@ -1229,8 +1229,8 @@ rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= storj.io/common v0.0.0-20220719163320-cd2ef8e1b9b0/go.mod h1:mCYV6Ud5+cdbuaxdPD5Zht/HYaIn0sffnnws9ErkrMQ= -storj.io/common v0.0.0-20230417173225-d1152ea3099a h1:B5AVXKsrqcynZdxznewcXU57VARFeRXSDpCmGnNwFtE= -storj.io/common v0.0.0-20230417173225-d1152ea3099a/go.mod h1:j5YdcshmpJL+oW1+3IyBnCsv/HGbFkbzNDtuZg24KF0= +storj.io/common v0.0.0-20230419134608-0971ce717d0c h1:v7SwkKqxtTp4w0tKpqeBu5d/8Dqd0Rxy/L1HT7O0qAY= +storj.io/common v0.0.0-20230419134608-0971ce717d0c/go.mod h1:j5YdcshmpJL+oW1+3IyBnCsv/HGbFkbzNDtuZg24KF0= storj.io/drpc v0.0.32/go.mod h1:6rcOyR/QQkSTX/9L5ZGtlZaE2PtXTTZl8d+ulSeeYEg= storj.io/drpc v0.0.33-0.20230417171205-2ca712ef4ab5 h1:4iOQovjXb6oAMLrjf0Qc4MuRRLd9hXC7+CWqOt+AzCw= storj.io/drpc v0.0.33-0.20230417171205-2ca712ef4ab5/go.mod h1:vR804UNzhBa49NOJ6HeLjd2H3MakC1j5Gv8bsOQT6N4= @@ -1242,5 +1242,5 @@ storj.io/private v0.0.0-20230405095015-9e5bbc1c7ca8 h1:bUSNdChb1E5a/IFAy1l5zq+oZ storj.io/private v0.0.0-20230405095015-9e5bbc1c7ca8/go.mod h1:JxBlgPwo+P0OOJDSPJLwBJWUPnhnvrHOlKAN0aV/bhY= storj.io/storjscan v0.0.0-20220926140643-1623c3b391b0 h1:pSfGf9E9OlUd17W7LSpL4tTONIyFji6dz8I2iTDd8BY= storj.io/storjscan v0.0.0-20220926140643-1623c3b391b0/go.mod h1:5nLgAOl1KTDVyqORAhvrp+167PtShEuS1L3pJgXPjwo= -storj.io/uplink v1.10.1-0.20230413192940-d37f89e8219e h1:y6CSddIrAAZ5tSeSLNlXRjo81NT0f4+vEJ5spS2YxuA= -storj.io/uplink v1.10.1-0.20230413192940-d37f89e8219e/go.mod h1:x6XS4VpmVMU2N/VXm7QGS2M4Ar1+FmWa0lZGYfhMCww= +storj.io/uplink v1.10.1-0.20230419134602-db8e801a38e4 h1:OXdKu4nUJiILbD2e2kLCSSpbVPfkCfrBodmOPba0N0E= +storj.io/uplink v1.10.1-0.20230419134602-db8e801a38e4/go.mod h1:Xq9HTfy/mnHm9X44OzRquLnpUMwdxdVnDyAnVTMNkPQ= diff --git a/testsuite/ui/go.mod b/testsuite/ui/go.mod index ade8fc89a..29aa70da7 100644 --- a/testsuite/ui/go.mod +++ b/testsuite/ui/go.mod @@ -10,7 +10,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.2 go.uber.org/zap v1.23.0 - storj.io/common v0.0.0-20230417173225-d1152ea3099a + storj.io/common v0.0.0-20230419134608-0971ce717d0c storj.io/gateway-mt v1.51.1-0.20230417204402-7d9bb25bc297 storj.io/private v0.0.0-20230405095015-9e5bbc1c7ca8 storj.io/storj v0.12.1-0.20221125175451-ef4b564b82f7 @@ -223,5 +223,5 @@ require ( storj.io/minio v0.0.0-20230118205046-c025fcc9eef3 // indirect storj.io/monkit-jaeger v0.0.0-20220915074555-d100d7589f41 // indirect storj.io/picobuf v0.0.1 // indirect - storj.io/uplink v1.10.1-0.20230413192940-d37f89e8219e // indirect + storj.io/uplink v1.10.1-0.20230419134602-db8e801a38e4 // indirect ) diff --git a/testsuite/ui/go.sum b/testsuite/ui/go.sum index 4a2d2b478..2f534e72c 100644 --- a/testsuite/ui/go.sum +++ b/testsuite/ui/go.sum @@ -1933,8 +1933,8 @@ sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1 sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= storj.io/common v0.0.0-20220719163320-cd2ef8e1b9b0/go.mod h1:mCYV6Ud5+cdbuaxdPD5Zht/HYaIn0sffnnws9ErkrMQ= -storj.io/common v0.0.0-20230417173225-d1152ea3099a h1:B5AVXKsrqcynZdxznewcXU57VARFeRXSDpCmGnNwFtE= -storj.io/common v0.0.0-20230417173225-d1152ea3099a/go.mod h1:j5YdcshmpJL+oW1+3IyBnCsv/HGbFkbzNDtuZg24KF0= +storj.io/common v0.0.0-20230419134608-0971ce717d0c h1:v7SwkKqxtTp4w0tKpqeBu5d/8Dqd0Rxy/L1HT7O0qAY= +storj.io/common v0.0.0-20230419134608-0971ce717d0c/go.mod h1:j5YdcshmpJL+oW1+3IyBnCsv/HGbFkbzNDtuZg24KF0= storj.io/dotworld v0.0.0-20210324183515-0d11aeccd840 h1:oqMwoF6vaOrCe92SKRyr8cc2WSjLYAd8fjpAHA7rNqY= storj.io/drpc v0.0.32/go.mod h1:6rcOyR/QQkSTX/9L5ZGtlZaE2PtXTTZl8d+ulSeeYEg= storj.io/drpc v0.0.33-0.20230417171205-2ca712ef4ab5 h1:4iOQovjXb6oAMLrjf0Qc4MuRRLd9hXC7+CWqOt+AzCw= @@ -1951,6 +1951,6 @@ storj.io/picobuf v0.0.1 h1:ekEvxSQCbEjTVIi/qxj2za13SJyfRE37yE30IBkZeT0= storj.io/picobuf v0.0.1/go.mod h1:7ZTAMs6VesgTHbbhFU79oQ9hDaJ+MD4uoFQZ1P4SEz0= storj.io/private v0.0.0-20230405095015-9e5bbc1c7ca8 h1:bUSNdChb1E5a/IFAy1l5zq+oZIYR5WPJ1JC71GC12dA= storj.io/private v0.0.0-20230405095015-9e5bbc1c7ca8/go.mod h1:JxBlgPwo+P0OOJDSPJLwBJWUPnhnvrHOlKAN0aV/bhY= -storj.io/uplink v1.10.1-0.20230413192940-d37f89e8219e h1:y6CSddIrAAZ5tSeSLNlXRjo81NT0f4+vEJ5spS2YxuA= -storj.io/uplink v1.10.1-0.20230413192940-d37f89e8219e/go.mod h1:x6XS4VpmVMU2N/VXm7QGS2M4Ar1+FmWa0lZGYfhMCww= +storj.io/uplink v1.10.1-0.20230419134602-db8e801a38e4 h1:OXdKu4nUJiILbD2e2kLCSSpbVPfkCfrBodmOPba0N0E= +storj.io/uplink v1.10.1-0.20230419134602-db8e801a38e4/go.mod h1:Xq9HTfy/mnHm9X44OzRquLnpUMwdxdVnDyAnVTMNkPQ= storj.io/zipper v0.0.0-20220124122551-2ac2d53a46f6 h1:vJQmb+uAiYn8hVfkhMl6OqjnUyMWSCPnkzW8IsjF8vE=