From f9b104f37b283740fce0735f4424c7c6bf1d72e1 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 22 Sep 2021 20:06:17 -0700 Subject: [PATCH] Revert "s3: Put bucket tagging to return an error when bucket is not found (#13232)" This reverts commit 91567ba91615b4f12a12de31d64c03a3bc20f706. Revert because the error was incorrectly converted, there are callers that rely on errConfigNotFound and it also took away the migration code. Instead the correct fix is PutBucketTaggingHandler() which is already added. --- cmd/api-errors.go | 2 -- cmd/bucket-metadata.go | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/cmd/api-errors.go b/cmd/api-errors.go index 46c57c327..1301d8ce7 100644 --- a/cmd/api-errors.go +++ b/cmd/api-errors.go @@ -1794,8 +1794,6 @@ func toAPIErrorCode(ctx context.Context, err error) (apiErr APIErrorCode) { } switch err { - case errVolumeNotFound: - apiErr = ErrNoSuchBucket case errInvalidArgument: apiErr = ErrAdminInvalidArgument case errNoSuchUser: diff --git a/cmd/bucket-metadata.go b/cmd/bucket-metadata.go index 41bb32436..f2142a0f3 100644 --- a/cmd/bucket-metadata.go +++ b/cmd/bucket-metadata.go @@ -123,9 +123,6 @@ func (b *BucketMetadata) Load(ctx context.Context, api ObjectLayer, name string) configFile := path.Join(bucketConfigPrefix, name, bucketMetadataFile) data, err := readConfig(ctx, api, configFile) if err != nil { - if err == errConfigNotFound { - err = errVolumeNotFound - } return err } if len(data) <= 4 { @@ -152,7 +149,7 @@ func (b *BucketMetadata) Load(ctx context.Context, api ObjectLayer, name string) func loadBucketMetadata(ctx context.Context, objectAPI ObjectLayer, bucket string) (BucketMetadata, error) { b := newBucketMetadata(bucket) err := b.Load(ctx, objectAPI, b.Name) - if err != nil { + if err != nil && !errors.Is(err, errConfigNotFound) { return b, err }