From d3c410212d13e93a43cb9e56bed84cb04d9ec0cc Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Tue, 27 Feb 2024 12:15:06 -0800 Subject: [PATCH 1/7] metric bucket should return nil when error is expected Signed-off-by: Ben Ye --- objstore.go | 29 +++++++++++++----- objstore_test.go | 78 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 97 insertions(+), 10 deletions(-) diff --git a/objstore.go b/objstore.go index 86ecfa2..1d3f17c 100644 --- a/objstore.go +++ b/objstore.go @@ -633,9 +633,12 @@ func (b *metricBucket) Iter(ctx context.Context, dir string, f func(string) erro err := b.bkt.Iter(ctx, dir, f, options...) if err != nil { - if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { + if b.metrics.isOpFailureExpected(err) { + err = nil + } else if ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } + return err } return err } @@ -668,7 +671,9 @@ func (b *metricBucket) Attributes(ctx context.Context, name string) (ObjectAttri start := time.Now() attrs, err := b.bkt.Attributes(ctx, name) if err != nil { - if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { + if b.metrics.isOpFailureExpected(err) { + err = nil + } else if ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } return attrs, err @@ -685,7 +690,9 @@ func (b *metricBucket) Get(ctx context.Context, name string) (io.ReadCloser, err rc, err := b.bkt.Get(ctx, name) if err != nil { - if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { + if b.metrics.isOpFailureExpected(err) { + err = nil + } else if ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } b.metrics.opsDuration.WithLabelValues(op).Observe(time.Since(start).Seconds()) @@ -712,7 +719,9 @@ func (b *metricBucket) GetRange(ctx context.Context, name string, off, length in rc, err := b.bkt.GetRange(ctx, name, off, length) if err != nil { - if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { + if b.metrics.isOpFailureExpected(err) { + err = nil + } else if ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } b.metrics.opsDuration.WithLabelValues(op).Observe(time.Since(start).Seconds()) @@ -738,7 +747,9 @@ func (b *metricBucket) Exists(ctx context.Context, name string) (bool, error) { start := time.Now() ok, err := b.bkt.Exists(ctx, name) if err != nil { - if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { + if b.metrics.isOpFailureExpected(err) { + err = nil + } else if ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } return false, err @@ -767,7 +778,9 @@ func (b *metricBucket) Upload(ctx context.Context, name string, r io.Reader) err defer trc.Close() err := b.bkt.Upload(ctx, name, trc) if err != nil { - if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { + if b.metrics.isOpFailureExpected(err) { + err = nil + } else if ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } return err @@ -783,7 +796,9 @@ func (b *metricBucket) Delete(ctx context.Context, name string) error { start := time.Now() if err := b.bkt.Delete(ctx, name); err != nil { - if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { + if b.metrics.isOpFailureExpected(err) { + err = nil + } else if ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } return err diff --git a/objstore_test.go b/objstore_test.go index b1f8292..9a0d28b 100644 --- a/objstore_test.go +++ b/objstore_test.go @@ -537,6 +537,54 @@ func TestDownloadDir_CleanUp(t *testing.T) { testutil.Assert(t, os.IsNotExist(err)) } +func TestBucketExpectedErrNoReturnError(t *testing.T) { + expectedErr := errors.New("test error") + + bucket := WrapWithMetrics(&mockBucket{ + get: func(_ context.Context, _ string) (io.ReadCloser, error) { + return nil, expectedErr + }, + getRange: func(ctx context.Context, name string, off, length int64) (io.ReadCloser, error) { + return nil, expectedErr + }, + upload: func(ctx context.Context, name string, r io.Reader) error { + return expectedErr + }, + iter: func(ctx context.Context, dir string, f func(string) error, options ...IterOption) error { + return expectedErr + }, + attributes: func(ctx context.Context, name string) (ObjectAttributes, error) { + return ObjectAttributes{}, expectedErr + }, + exists: func(ctx context.Context, name string) (bool, error) { + return false, expectedErr + }, + }, nil, "").WithExpectedErrs(func(err error) bool { + return errors.Is(err, expectedErr) + }) + + // Expect no error to be returned since the error is expected. + _, err := bucket.Get(context.Background(), "") + testutil.Ok(t, err) + + _, err = bucket.GetRange(context.Background(), "", 1, 2) + testutil.Ok(t, err) + + err = bucket.Upload(context.Background(), "", nil) + testutil.Ok(t, err) + + err = bucket.Iter(context.Background(), "", func(s string) error { + return nil + }) + testutil.Ok(t, err) + + _, err = bucket.Exists(context.Background(), "") + testutil.Ok(t, err) + + _, err = bucket.Attributes(context.Background(), "") + testutil.Ok(t, err) +} + // unreliableBucket implements Bucket and returns an error on every n-th Get. type unreliableBucket struct { Bucket @@ -570,9 +618,12 @@ func (r *mockReader) Close() error { type mockBucket struct { Bucket - upload func(ctx context.Context, name string, r io.Reader) error - get func(ctx context.Context, name string) (io.ReadCloser, error) - getRange func(ctx context.Context, name string, off, length int64) (io.ReadCloser, error) + upload func(ctx context.Context, name string, r io.Reader) error + get func(ctx context.Context, name string) (io.ReadCloser, error) + getRange func(ctx context.Context, name string, off, length int64) (io.ReadCloser, error) + iter func(ctx context.Context, dir string, f func(string) error, options ...IterOption) error + attributes func(ctx context.Context, name string) (ObjectAttributes, error) + exists func(ctx context.Context, name string) (bool, error) } func (b *mockBucket) Upload(ctx context.Context, name string, r io.Reader) error { @@ -596,6 +647,27 @@ func (b *mockBucket) GetRange(ctx context.Context, name string, off, length int6 return nil, errors.New("GetRange has not been mocked") } +func (b *mockBucket) Iter(ctx context.Context, dir string, f func(string) error, options ...IterOption) error { + if b.iter != nil { + return b.iter(ctx, dir, f, options...) + } + return errors.New("Iter has not been mocked") +} + +func (b *mockBucket) Exists(ctx context.Context, name string) (bool, error) { + if b.exists != nil { + return b.exists(ctx, name) + } + return false, errors.New("Exists has not been mocked") +} + +func (b *mockBucket) Attributes(ctx context.Context, name string) (ObjectAttributes, error) { + if b.attributes != nil { + return b.attributes(ctx, name) + } + return ObjectAttributes{}, errors.New("Attributes has not been mocked") +} + func Test_TryToGetSizeLimitedReader(t *testing.T) { b := &bytes.Buffer{} r := io.LimitReader(b, 1024) From 383edf7cb17ee09359b704439ca4cec400e72f3c Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Tue, 27 Feb 2024 13:30:38 -0800 Subject: [PATCH 2/7] fix acceptance test Signed-off-by: Ben Ye --- objstore_test.go | 4 ++-- objtesting/acceptance_e2e_test.go | 2 +- prefixed_bucket_test.go | 2 +- testing.go | 18 +++++++++++++----- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/objstore_test.go b/objstore_test.go index 9a0d28b..79c94ee 100644 --- a/objstore_test.go +++ b/objstore_test.go @@ -28,7 +28,7 @@ func TestMetricBucket_Close(t *testing.T) { testutil.Equals(t, 7, promtest.CollectAndCount(bkt.metrics.opsFailures)) testutil.Equals(t, 7, promtest.CollectAndCount(bkt.metrics.opsDuration)) - AcceptanceTest(t, bkt.WithExpectedErrs(bkt.IsObjNotFoundErr)) + AcceptanceTest(t, bkt.WithExpectedErrs(bkt.IsObjNotFoundErr), true) testutil.Equals(t, float64(9), promtest.ToFloat64(bkt.metrics.ops.WithLabelValues(OpIter))) testutil.Equals(t, float64(2), promtest.ToFloat64(bkt.metrics.ops.WithLabelValues(OpAttributes))) testutil.Equals(t, float64(3), promtest.ToFloat64(bkt.metrics.ops.WithLabelValues(OpGet))) @@ -51,7 +51,7 @@ func TestMetricBucket_Close(t *testing.T) { // Clear bucket, but don't clear metrics to ensure we use same. bkt.bkt = NewInMemBucket() - AcceptanceTest(t, bkt) + AcceptanceTestWithoutNotFoundErr(t, bkt) testutil.Equals(t, float64(18), promtest.ToFloat64(bkt.metrics.ops.WithLabelValues(OpIter))) testutil.Equals(t, float64(4), promtest.ToFloat64(bkt.metrics.ops.WithLabelValues(OpAttributes))) testutil.Equals(t, float64(6), promtest.ToFloat64(bkt.metrics.ops.WithLabelValues(OpGet))) diff --git a/objtesting/acceptance_e2e_test.go b/objtesting/acceptance_e2e_test.go index e162cee..611dd38 100644 --- a/objtesting/acceptance_e2e_test.go +++ b/objtesting/acceptance_e2e_test.go @@ -14,5 +14,5 @@ import ( // NOTE: This test assumes strong consistency, but in the same way it does not guarantee that if it passes, the // used object store is strongly consistent. func TestObjStore_AcceptanceTest_e2e(t *testing.T) { - ForeachStore(t, objstore.AcceptanceTest) + ForeachStore(t, objstore.AcceptanceTestWithoutNotFoundErr) } diff --git a/prefixed_bucket_test.go b/prefixed_bucket_test.go index 6252e05..230b54c 100644 --- a/prefixed_bucket_test.go +++ b/prefixed_bucket_test.go @@ -23,7 +23,7 @@ func TestPrefixedBucket_Acceptance(t *testing.T) { "someprefix"} for _, prefix := range prefixes { - AcceptanceTest(t, NewPrefixedBucket(NewInMemBucket(), prefix)) + AcceptanceTestWithoutNotFoundErr(t, NewPrefixedBucket(NewInMemBucket(), prefix)) UsesPrefixTest(t, NewInMemBucket(), prefix) } } diff --git a/testing.go b/testing.go index 80f1e19..bd6fe85 100644 --- a/testing.go +++ b/testing.go @@ -80,7 +80,11 @@ func (b noopInstrumentedBucket) ReaderWithExpectedErrs(IsOpFailureExpectedFunc) return b } -func AcceptanceTest(t *testing.T, bkt Bucket) { +func AcceptanceTestWithoutNotFoundErr(t *testing.T, bkt Bucket) { + AcceptanceTest(t, bkt, false) +} + +func AcceptanceTest(t *testing.T, bkt Bucket, expectedNotFoundErr bool) { ctx := context.Background() _, err := bkt.Get(ctx, "") @@ -88,16 +92,20 @@ func AcceptanceTest(t *testing.T, bkt Bucket) { testutil.Assert(t, !bkt.IsObjNotFoundErr(err), "expected user error got not found %s", err) _, err = bkt.Get(ctx, "id1/obj_1.some") - testutil.NotOk(t, err) - testutil.Assert(t, bkt.IsObjNotFoundErr(err), "expected not found error got %s", err) + if !expectedNotFoundErr { + testutil.NotOk(t, err) + testutil.Assert(t, bkt.IsObjNotFoundErr(err), "expected not found error got %s", err) + } ok, err := bkt.Exists(ctx, "id1/obj_1.some") testutil.Ok(t, err) testutil.Assert(t, !ok, "expected not exits") _, err = bkt.Attributes(ctx, "id1/obj_1.some") - testutil.NotOk(t, err) - testutil.Assert(t, bkt.IsObjNotFoundErr(err), "expected not found error but got %s", err) + if !expectedNotFoundErr { + testutil.NotOk(t, err) + testutil.Assert(t, bkt.IsObjNotFoundErr(err), "expected not found error got %s", err) + } // Upload first object. testutil.Ok(t, bkt.Upload(ctx, "id1/obj_1.some", strings.NewReader("@test-data@"))) From 0c01d64a8313d844d14a93ce48622af87f0ad88c Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Wed, 11 Dec 2024 21:03:30 -0800 Subject: [PATCH 3/7] address comment and handle new IterWithAttributes method Signed-off-by: Ben Ye --- objstore.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/objstore.go b/objstore.go index 1d3f17c..0bdd3f4 100644 --- a/objstore.go +++ b/objstore.go @@ -638,7 +638,6 @@ func (b *metricBucket) Iter(ctx context.Context, dir string, f func(string) erro } else if ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } - return err } return err } @@ -652,7 +651,9 @@ func (b *metricBucket) IterWithAttributes(ctx context.Context, dir string, f fun err := b.bkt.IterWithAttributes(ctx, dir, f, options...) if err != nil { - if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { + if b.metrics.isOpFailureExpected(err) { + err = nil + } else if ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } } From 238812f5b3f299718ebb8b0b722f6e3c1baafbf3 Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Thu, 12 Dec 2024 13:32:07 -0800 Subject: [PATCH 4/7] update changelog Signed-off-by: Ben Ye --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0779d6..c068dbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,4 +68,6 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#71](https://github.com/thanos-io/objstore/pull/71) Replace method `IsCustomerManagedKeyError` for a more generic `IsAccessDeniedErr` on the bucket interface. - [#89](https://github.com/thanos-io/objstore/pull/89) GCS: Upgrade cloud.google.com/go/storage version to `v1.35.1`. - [#123](https://github.com/thanos-io/objstore/pull/123) *: Upgrade minio-go version to `v7.0.71`. +- [#103](https://github.com/thanos-io/objstore/pull/103) *: Don't return error in metric bucket if the error is expected. + ### Removed From bc2e25bd211a77c5a9c6a4f9b23b2120be529234 Mon Sep 17 00:00:00 2001 From: Arve Knudsen Date: Mon, 16 Dec 2024 10:00:08 +0100 Subject: [PATCH 5/7] Revert "Merge pull request #103 from thanos-io/do-not-return-error-when-expected" This reverts commit d69df7208cbace59b1e25d0284b98640045e5749, reversing changes made to 8d266b99071651d4211e4a64fcdfb66da9841929. Signed-off-by: Arve Knudsen --- CHANGELOG.md | 2 - objstore.go | 32 +++--------- objstore_test.go | 82 ++----------------------------- objtesting/acceptance_e2e_test.go | 2 +- prefixed_bucket_test.go | 2 +- testing.go | 18 ++----- 6 files changed, 20 insertions(+), 118 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c068dbb..d0779d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,4 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#71](https://github.com/thanos-io/objstore/pull/71) Replace method `IsCustomerManagedKeyError` for a more generic `IsAccessDeniedErr` on the bucket interface. - [#89](https://github.com/thanos-io/objstore/pull/89) GCS: Upgrade cloud.google.com/go/storage version to `v1.35.1`. - [#123](https://github.com/thanos-io/objstore/pull/123) *: Upgrade minio-go version to `v7.0.71`. -- [#103](https://github.com/thanos-io/objstore/pull/103) *: Don't return error in metric bucket if the error is expected. - ### Removed diff --git a/objstore.go b/objstore.go index 0bdd3f4..86ecfa2 100644 --- a/objstore.go +++ b/objstore.go @@ -633,9 +633,7 @@ func (b *metricBucket) Iter(ctx context.Context, dir string, f func(string) erro err := b.bkt.Iter(ctx, dir, f, options...) if err != nil { - if b.metrics.isOpFailureExpected(err) { - err = nil - } else if ctx.Err() != context.Canceled { + if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } } @@ -651,9 +649,7 @@ func (b *metricBucket) IterWithAttributes(ctx context.Context, dir string, f fun err := b.bkt.IterWithAttributes(ctx, dir, f, options...) if err != nil { - if b.metrics.isOpFailureExpected(err) { - err = nil - } else if ctx.Err() != context.Canceled { + if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } } @@ -672,9 +668,7 @@ func (b *metricBucket) Attributes(ctx context.Context, name string) (ObjectAttri start := time.Now() attrs, err := b.bkt.Attributes(ctx, name) if err != nil { - if b.metrics.isOpFailureExpected(err) { - err = nil - } else if ctx.Err() != context.Canceled { + if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } return attrs, err @@ -691,9 +685,7 @@ func (b *metricBucket) Get(ctx context.Context, name string) (io.ReadCloser, err rc, err := b.bkt.Get(ctx, name) if err != nil { - if b.metrics.isOpFailureExpected(err) { - err = nil - } else if ctx.Err() != context.Canceled { + if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } b.metrics.opsDuration.WithLabelValues(op).Observe(time.Since(start).Seconds()) @@ -720,9 +712,7 @@ func (b *metricBucket) GetRange(ctx context.Context, name string, off, length in rc, err := b.bkt.GetRange(ctx, name, off, length) if err != nil { - if b.metrics.isOpFailureExpected(err) { - err = nil - } else if ctx.Err() != context.Canceled { + if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } b.metrics.opsDuration.WithLabelValues(op).Observe(time.Since(start).Seconds()) @@ -748,9 +738,7 @@ func (b *metricBucket) Exists(ctx context.Context, name string) (bool, error) { start := time.Now() ok, err := b.bkt.Exists(ctx, name) if err != nil { - if b.metrics.isOpFailureExpected(err) { - err = nil - } else if ctx.Err() != context.Canceled { + if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } return false, err @@ -779,9 +767,7 @@ func (b *metricBucket) Upload(ctx context.Context, name string, r io.Reader) err defer trc.Close() err := b.bkt.Upload(ctx, name, trc) if err != nil { - if b.metrics.isOpFailureExpected(err) { - err = nil - } else if ctx.Err() != context.Canceled { + if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } return err @@ -797,9 +783,7 @@ func (b *metricBucket) Delete(ctx context.Context, name string) error { start := time.Now() if err := b.bkt.Delete(ctx, name); err != nil { - if b.metrics.isOpFailureExpected(err) { - err = nil - } else if ctx.Err() != context.Canceled { + if !b.metrics.isOpFailureExpected(err) && ctx.Err() != context.Canceled { b.metrics.opsFailures.WithLabelValues(op).Inc() } return err diff --git a/objstore_test.go b/objstore_test.go index 79c94ee..b1f8292 100644 --- a/objstore_test.go +++ b/objstore_test.go @@ -28,7 +28,7 @@ func TestMetricBucket_Close(t *testing.T) { testutil.Equals(t, 7, promtest.CollectAndCount(bkt.metrics.opsFailures)) testutil.Equals(t, 7, promtest.CollectAndCount(bkt.metrics.opsDuration)) - AcceptanceTest(t, bkt.WithExpectedErrs(bkt.IsObjNotFoundErr), true) + AcceptanceTest(t, bkt.WithExpectedErrs(bkt.IsObjNotFoundErr)) testutil.Equals(t, float64(9), promtest.ToFloat64(bkt.metrics.ops.WithLabelValues(OpIter))) testutil.Equals(t, float64(2), promtest.ToFloat64(bkt.metrics.ops.WithLabelValues(OpAttributes))) testutil.Equals(t, float64(3), promtest.ToFloat64(bkt.metrics.ops.WithLabelValues(OpGet))) @@ -51,7 +51,7 @@ func TestMetricBucket_Close(t *testing.T) { // Clear bucket, but don't clear metrics to ensure we use same. bkt.bkt = NewInMemBucket() - AcceptanceTestWithoutNotFoundErr(t, bkt) + AcceptanceTest(t, bkt) testutil.Equals(t, float64(18), promtest.ToFloat64(bkt.metrics.ops.WithLabelValues(OpIter))) testutil.Equals(t, float64(4), promtest.ToFloat64(bkt.metrics.ops.WithLabelValues(OpAttributes))) testutil.Equals(t, float64(6), promtest.ToFloat64(bkt.metrics.ops.WithLabelValues(OpGet))) @@ -537,54 +537,6 @@ func TestDownloadDir_CleanUp(t *testing.T) { testutil.Assert(t, os.IsNotExist(err)) } -func TestBucketExpectedErrNoReturnError(t *testing.T) { - expectedErr := errors.New("test error") - - bucket := WrapWithMetrics(&mockBucket{ - get: func(_ context.Context, _ string) (io.ReadCloser, error) { - return nil, expectedErr - }, - getRange: func(ctx context.Context, name string, off, length int64) (io.ReadCloser, error) { - return nil, expectedErr - }, - upload: func(ctx context.Context, name string, r io.Reader) error { - return expectedErr - }, - iter: func(ctx context.Context, dir string, f func(string) error, options ...IterOption) error { - return expectedErr - }, - attributes: func(ctx context.Context, name string) (ObjectAttributes, error) { - return ObjectAttributes{}, expectedErr - }, - exists: func(ctx context.Context, name string) (bool, error) { - return false, expectedErr - }, - }, nil, "").WithExpectedErrs(func(err error) bool { - return errors.Is(err, expectedErr) - }) - - // Expect no error to be returned since the error is expected. - _, err := bucket.Get(context.Background(), "") - testutil.Ok(t, err) - - _, err = bucket.GetRange(context.Background(), "", 1, 2) - testutil.Ok(t, err) - - err = bucket.Upload(context.Background(), "", nil) - testutil.Ok(t, err) - - err = bucket.Iter(context.Background(), "", func(s string) error { - return nil - }) - testutil.Ok(t, err) - - _, err = bucket.Exists(context.Background(), "") - testutil.Ok(t, err) - - _, err = bucket.Attributes(context.Background(), "") - testutil.Ok(t, err) -} - // unreliableBucket implements Bucket and returns an error on every n-th Get. type unreliableBucket struct { Bucket @@ -618,12 +570,9 @@ func (r *mockReader) Close() error { type mockBucket struct { Bucket - upload func(ctx context.Context, name string, r io.Reader) error - get func(ctx context.Context, name string) (io.ReadCloser, error) - getRange func(ctx context.Context, name string, off, length int64) (io.ReadCloser, error) - iter func(ctx context.Context, dir string, f func(string) error, options ...IterOption) error - attributes func(ctx context.Context, name string) (ObjectAttributes, error) - exists func(ctx context.Context, name string) (bool, error) + upload func(ctx context.Context, name string, r io.Reader) error + get func(ctx context.Context, name string) (io.ReadCloser, error) + getRange func(ctx context.Context, name string, off, length int64) (io.ReadCloser, error) } func (b *mockBucket) Upload(ctx context.Context, name string, r io.Reader) error { @@ -647,27 +596,6 @@ func (b *mockBucket) GetRange(ctx context.Context, name string, off, length int6 return nil, errors.New("GetRange has not been mocked") } -func (b *mockBucket) Iter(ctx context.Context, dir string, f func(string) error, options ...IterOption) error { - if b.iter != nil { - return b.iter(ctx, dir, f, options...) - } - return errors.New("Iter has not been mocked") -} - -func (b *mockBucket) Exists(ctx context.Context, name string) (bool, error) { - if b.exists != nil { - return b.exists(ctx, name) - } - return false, errors.New("Exists has not been mocked") -} - -func (b *mockBucket) Attributes(ctx context.Context, name string) (ObjectAttributes, error) { - if b.attributes != nil { - return b.attributes(ctx, name) - } - return ObjectAttributes{}, errors.New("Attributes has not been mocked") -} - func Test_TryToGetSizeLimitedReader(t *testing.T) { b := &bytes.Buffer{} r := io.LimitReader(b, 1024) diff --git a/objtesting/acceptance_e2e_test.go b/objtesting/acceptance_e2e_test.go index 611dd38..e162cee 100644 --- a/objtesting/acceptance_e2e_test.go +++ b/objtesting/acceptance_e2e_test.go @@ -14,5 +14,5 @@ import ( // NOTE: This test assumes strong consistency, but in the same way it does not guarantee that if it passes, the // used object store is strongly consistent. func TestObjStore_AcceptanceTest_e2e(t *testing.T) { - ForeachStore(t, objstore.AcceptanceTestWithoutNotFoundErr) + ForeachStore(t, objstore.AcceptanceTest) } diff --git a/prefixed_bucket_test.go b/prefixed_bucket_test.go index 230b54c..6252e05 100644 --- a/prefixed_bucket_test.go +++ b/prefixed_bucket_test.go @@ -23,7 +23,7 @@ func TestPrefixedBucket_Acceptance(t *testing.T) { "someprefix"} for _, prefix := range prefixes { - AcceptanceTestWithoutNotFoundErr(t, NewPrefixedBucket(NewInMemBucket(), prefix)) + AcceptanceTest(t, NewPrefixedBucket(NewInMemBucket(), prefix)) UsesPrefixTest(t, NewInMemBucket(), prefix) } } diff --git a/testing.go b/testing.go index bd6fe85..80f1e19 100644 --- a/testing.go +++ b/testing.go @@ -80,11 +80,7 @@ func (b noopInstrumentedBucket) ReaderWithExpectedErrs(IsOpFailureExpectedFunc) return b } -func AcceptanceTestWithoutNotFoundErr(t *testing.T, bkt Bucket) { - AcceptanceTest(t, bkt, false) -} - -func AcceptanceTest(t *testing.T, bkt Bucket, expectedNotFoundErr bool) { +func AcceptanceTest(t *testing.T, bkt Bucket) { ctx := context.Background() _, err := bkt.Get(ctx, "") @@ -92,20 +88,16 @@ func AcceptanceTest(t *testing.T, bkt Bucket, expectedNotFoundErr bool) { testutil.Assert(t, !bkt.IsObjNotFoundErr(err), "expected user error got not found %s", err) _, err = bkt.Get(ctx, "id1/obj_1.some") - if !expectedNotFoundErr { - testutil.NotOk(t, err) - testutil.Assert(t, bkt.IsObjNotFoundErr(err), "expected not found error got %s", err) - } + testutil.NotOk(t, err) + testutil.Assert(t, bkt.IsObjNotFoundErr(err), "expected not found error got %s", err) ok, err := bkt.Exists(ctx, "id1/obj_1.some") testutil.Ok(t, err) testutil.Assert(t, !ok, "expected not exits") _, err = bkt.Attributes(ctx, "id1/obj_1.some") - if !expectedNotFoundErr { - testutil.NotOk(t, err) - testutil.Assert(t, bkt.IsObjNotFoundErr(err), "expected not found error got %s", err) - } + testutil.NotOk(t, err) + testutil.Assert(t, bkt.IsObjNotFoundErr(err), "expected not found error but got %s", err) // Upload first object. testutil.Ok(t, bkt.Upload(ctx, "id1/obj_1.some", strings.NewReader("@test-data@"))) From 063ea3806b2ffe238d4a7b335b6dc1bf6c608a05 Mon Sep 17 00:00:00 2001 From: matthewhudsonedb <94822000+matthewhudsonedb@users.noreply.github.com> Date: Tue, 17 Dec 2024 22:18:33 +1100 Subject: [PATCH 6/7] s3:bump aws-sdk-go-v2/config for aws service endpoint env vars (#132) * bump aws-sdk-go-v2/config for aws service endpoint env vars Signed-off-by: matthewhudsonedb * add changelog entry Signed-off-by: matthewhudsonedb --------- Signed-off-by: matthewhudsonedb Signed-off-by: matthewhudsonedb <94822000+matthewhudsonedb@users.noreply.github.com> --- CHANGELOG.md | 2 ++ go.mod | 24 +++++++++++++----------- go.sum | 52 +++++++++++++++++++++++++++------------------------- 3 files changed, 42 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0779d6..a755503 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,4 +68,6 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#71](https://github.com/thanos-io/objstore/pull/71) Replace method `IsCustomerManagedKeyError` for a more generic `IsAccessDeniedErr` on the bucket interface. - [#89](https://github.com/thanos-io/objstore/pull/89) GCS: Upgrade cloud.google.com/go/storage version to `v1.35.1`. - [#123](https://github.com/thanos-io/objstore/pull/123) *: Upgrade minio-go version to `v7.0.71`. +- [#132](https://github.com/thanos-io/objstore/pull/132) s3: Upgrade aws-sdk-go-v2/config version to `v1.27.30` + ### Removed diff --git a/go.mod b/go.mod index 4555b6b..12d617f 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,8 @@ go 1.22 require ( cloud.google.com/go/storage v1.43.0 github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible - github.com/aws/aws-sdk-go-v2 v1.16.0 - github.com/aws/aws-sdk-go-v2/config v1.15.1 + github.com/aws/aws-sdk-go-v2 v1.30.4 + github.com/aws/aws-sdk-go-v2/config v1.27.30 github.com/baidubce/bce-sdk-go v0.9.111 github.com/efficientgo/core v1.0.0-rc.0.0.20221201130417-ba593f67d2a4 github.com/efficientgo/e2e v0.13.1-0.20220922081603-45de9fc588a8 @@ -43,15 +43,17 @@ require ( github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.11.0 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.1 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.7 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.1 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.8 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.11.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.16.1 // indirect - github.com/aws/smithy-go v1.11.1 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.29 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.30.5 // indirect + github.com/aws/smithy-go v1.20.4 // indirect github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bluele/gcache v0.0.2 // indirect diff --git a/go.sum b/go.sum index c010a36..8ee7b24 100644 --- a/go.sum +++ b/go.sum @@ -33,28 +33,32 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAu github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible h1:9gWa46nstkJ9miBReJcN8Gq34cBFbzSpQZVVT9N09TM= github.com/aliyun/aliyun-oss-go-sdk v2.2.2+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= -github.com/aws/aws-sdk-go-v2 v1.16.0 h1:cBAYjiiexRAg9v2z9vb6IdxAa7ef4KCtjW7w7e3GxGo= -github.com/aws/aws-sdk-go-v2 v1.16.0/go.mod h1:lJYcuZZEHWNIb6ugJjbQY1fykdoobWbOS7kJYb4APoI= -github.com/aws/aws-sdk-go-v2/config v1.15.1 h1:hTIZFepYESYyowQUBo47lu69WSxsYqGUILY9Nu8+7pY= -github.com/aws/aws-sdk-go-v2/config v1.15.1/go.mod h1:MZHGbuW2WnqIOQQBKu2ZkhTjuutZSTnn56TDq4QyydE= -github.com/aws/aws-sdk-go-v2/credentials v1.11.0 h1:gc4Uhs80s60nmLon5Z4JXWinX2BkAGT0YROoUT8h8U4= -github.com/aws/aws-sdk-go-v2/credentials v1.11.0/go.mod h1:EdV1ZFgtZ4XM5RDHWcRWK8H+xW5duNVBqWj2oLu7tRo= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.1 h1:F9Je1nq5YXfMOv6451NHvMf6U0iTWeMnsG0MMIQoUmk= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.1/go.mod h1:Yph0XsTbQ5GGZ2+mO1a03P/SO9fdX3t1nejIp2tq79g= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.7 h1:KUErSJgdqmqAPBWAp6Zx9CjL0YXfytXJeXcsWnuCM1c= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.7/go.mod h1:oB9nZcxH1cGq7NPGurVJwxrO2vmJ9mmEBayCwcAlmT8= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.1 h1:feVfa9eJonhJiss7g51ikjNB2DrUzbNZNvPL8pw/54k= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.1/go.mod h1:K4vz7lRYCyLYpYAMCLObODahFgARdD3YVa0MvQte9Co= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.8 h1:adr3PfiggFtqgFofAMUFCtdvwzpf3QxPES4ezK4M3iI= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.8/go.mod h1:wLbQYt36AJqaRZUQiCNXzbtkNigyPfKHrotHuIDiCy8= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.1 h1:B/SPX7J+Y0Yrcjv60Nhbh1gC2uBN47SfN8JYre6Mp4M= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.1/go.mod h1:2Hhr9Eh1gJzDatwACX/ozAZ/ljq5vzvPRu5cdu25tzc= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.1 h1:DyHctRsJIAWIvom1Itb4T84D2jwpIu+KIi3d0SFaswg= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.1/go.mod h1:CvFTucADIx7U/M44vjLs/ZttpQHdpxwK+62+dUGhDeY= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.1 h1:xsOtPAvHqhvQvBza5ohaUcfq1LceH2lZKMUGZJKiZiM= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.1/go.mod h1:Aq2/Qggh2oemSfyHH+EO4UBbgWG6zFCXLHYI4ILTY7w= -github.com/aws/smithy-go v1.11.1 h1:IQ+lPZVkSM3FRtyaDox41R8YS6iwPMYIreejOgPW49g= -github.com/aws/smithy-go v1.11.1/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnwub1bgM= +github.com/aws/aws-sdk-go-v2 v1.30.4 h1:frhcagrVNrzmT95RJImMHgabt99vkXGslubDaDagTk8= +github.com/aws/aws-sdk-go-v2 v1.30.4/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0= +github.com/aws/aws-sdk-go-v2/config v1.27.30 h1:AQF3/+rOgeJBQP3iI4vojlPib5X6eeOYoa/af7OxAYg= +github.com/aws/aws-sdk-go-v2/config v1.27.30/go.mod h1:yxqvuubha9Vw8stEgNiStO+yZpP68Wm9hLmcm+R/Qk4= +github.com/aws/aws-sdk-go-v2/credentials v1.17.29 h1:CwGsupsXIlAFYuDVHv1nnK0wnxO0wZ/g1L8DSK/xiIw= +github.com/aws/aws-sdk-go-v2/credentials v1.17.29/go.mod h1:BPJ/yXV92ZVq6G8uYvbU0gSl8q94UB63nMT5ctNO38g= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 h1:yjwoSyDZF8Jth+mUk5lSPJCkMC0lMy6FaCD51jm6ayE= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12/go.mod h1:fuR57fAgMk7ot3WcNQfb6rSEn+SUffl7ri+aa8uKysI= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16 h1:TNyt/+X43KJ9IJJMjKfa3bNTiZbUP7DeCxfbTROESwY= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.16/go.mod h1:2DwJF39FlNAUiX5pAc0UNeiz16lK2t7IaFcm0LFHEgc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 h1:jYfy8UPmd+6kJW5YhY0L1/KftReOGxI/4NtVSTh9O/I= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16/go.mod h1:7ZfEPZxkW42Afq4uQB8H2E2e6ebh6mXTueEpYzjCzcs= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 h1:KypMCbLPPHEmf9DgMGw51jMj77VfGPAN2Kv4cfhlfgI= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4/go.mod h1:Vz1JQXliGcQktFTN/LN6uGppAIRoLBR2bMvIMP0gOjc= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 h1:tJ5RnkHCiSH0jyd6gROjlJtNwov0eGYNz8s8nFcR0jQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18/go.mod h1:++NHzT+nAF7ZPrHPsA+ENvsXkOO8wEu+C6RXltAG4/c= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 h1:zCsFCKvbj25i7p1u94imVoO447I/sFv8qq+lGJhRN0c= +github.com/aws/aws-sdk-go-v2/service/sso v1.22.5/go.mod h1:ZeDX1SnKsVlejeuz41GiajjZpRSWR7/42q/EyA/QEiM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 h1:SKvPgvdvmiTWoi0GAJ7AsJfOz3ngVkD/ERbs5pUnHNI= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5/go.mod h1:20sz31hv/WsPa3HhU3hfrIet2kxM4Pe0r20eBZ20Tac= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.5 h1:OMsEmCyz2i89XwRwPouAJvhj81wINh+4UK+k/0Yo/q8= +github.com/aws/aws-sdk-go-v2/service/sts v1.30.5/go.mod h1:vmSqFK+BVIwVpDAGZB3CoCXHzurt4qBE8lf+I/kRTh0= +github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4= +github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/baidubce/bce-sdk-go v0.9.111 h1:yGgtPpZYUZW4uoVorQ4xnuEgVeddACydlcJKW87MDV4= github.com/baidubce/bce-sdk-go v0.9.111/go.mod h1:zbYJMQwE4IZuyrJiFO8tO8NbtYiKTFTbwh4eIsqjVdg= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f h1:ZNv7On9kyUzm7fvRZumSyy/IUiSC7AzL0I1jKKtwooA= @@ -134,6 +138,7 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -154,8 +159,6 @@ github.com/googleapis/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBY github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.3+incompatible h1:tKTaPHNVwikS3I1rdyf1INNvgJXWSf/+TzqsiGbrgnQ= github.com/huaweicloud/huaweicloud-sdk-go-obs v3.23.3+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= @@ -326,7 +329,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 2654df1dec4abda8af2d96f7e927550f29566940 Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Wed, 25 Dec 2024 17:56:19 -0800 Subject: [PATCH 7/7] fix OCI test bucket panic Signed-off-by: Ben Ye --- providers/oci/oci.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/oci/oci.go b/providers/oci/oci.go index 7b4230e..6d5b6c0 100644 --- a/providers/oci/oci.go +++ b/providers/oci/oci.go @@ -355,7 +355,7 @@ func NewBucket(logger log.Logger, ociConfig []byte, wrapRoundtripper func(http.R return nil, errors.Wrapf(err, "unable to create OKE workload identity config provider") } default: - return nil, errors.Wrapf(err, fmt.Sprintf("unsupported OCI provider: %s", provider)) + return nil, fmt.Errorf("unsupported OCI provider: %s", provider) } client, err := objectstorage.NewObjectStorageClientWithConfigurationProvider(configurationProvider)