diff --git a/private/bucket/buckets.go b/private/bucket/buckets.go index 48f6cb72..143fa74d 100644 --- a/private/bucket/buckets.go +++ b/private/bucket/buckets.go @@ -194,7 +194,7 @@ func GetBucketObjectLockConfiguration(ctx context.Context, project *uplink.Proje Name: []byte(bucketName), }) if errs2.IsRPC(err, rpcstatus.NotFound) { - if strings.HasSuffix(errs.Unwrap(err).Error(), "no Object Lock configuration") { + if strings.HasPrefix(errs.Unwrap(err).Error(), "Object Lock is not enabled for this") { err = ErrBucketObjectLockConfigurationNotFound } } diff --git a/testsuite/private/bucket/buckets_test.go b/testsuite/private/bucket/buckets_test.go index ddad7c4d..1598f014 100644 --- a/testsuite/private/bucket/buckets_test.go +++ b/testsuite/private/bucket/buckets_test.go @@ -252,7 +252,7 @@ func TestCreateBucketWithObjectLock(t *testing.T) { require.NoError(t, err) _, err = bucket.GetBucketObjectLockConfiguration(ctx, project, "test-bucket") - require.Error(t, err) + require.ErrorIs(t, err, bucket.ErrBucketObjectLockConfigurationNotFound) _, err = bucket.CreateBucketWithObjectLock(ctx, project, bucket.CreateBucketWithObjectLockParams{ Name: "test-bucket",