From 6b1f2fc13365f883abfa0348884ef5ea61dc5250 Mon Sep 17 00:00:00 2001 From: astorath Date: Sat, 8 Feb 2020 14:16:59 +0300 Subject: [PATCH] fix: using correct response on get_bucket_lifecycle_configuration (#8962) --- cmd/api-errors.go | 8 +++++++- cmd/gateway-common.go | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/api-errors.go b/cmd/api-errors.go index b70437193..0e6cec8ba 100644 --- a/cmd/api-errors.go +++ b/cmd/api-errors.go @@ -97,6 +97,7 @@ const ( ErrNoSuchBucket ErrNoSuchBucketPolicy ErrNoSuchBucketLifecycle + ErrNoSuchLifecycleConfiguration ErrNoSuchBucketSSEConfig ErrNoSuchKey ErrNoSuchUpload @@ -489,6 +490,11 @@ var errorCodes = errorCodeMap{ Description: "The bucket lifecycle configuration does not exist", HTTPStatusCode: http.StatusNotFound, }, + ErrNoSuchLifecycleConfiguration: { + Code: "NoSuchLifecycleConfiguration", + Description: "The lifecycle configuration does not exist", + HTTPStatusCode: http.StatusNotFound, + }, ErrNoSuchBucketSSEConfig: { Code: "ServerSideEncryptionConfigurationNotFoundError", Description: "The server side encryption configuration was not found", @@ -1725,7 +1731,7 @@ func toAPIErrorCode(ctx context.Context, err error) (apiErr APIErrorCode) { case BucketPolicyNotFound: apiErr = ErrNoSuchBucketPolicy case BucketLifecycleNotFound: - apiErr = ErrNoSuchBucketLifecycle + apiErr = ErrNoSuchLifecycleConfiguration case BucketSSEConfigNotFound: apiErr = ErrNoSuchBucketSSEConfig case *event.ErrInvalidEventName: diff --git a/cmd/gateway-common.go b/cmd/gateway-common.go index 378bee23d..c4483209e 100644 --- a/cmd/gateway-common.go +++ b/cmd/gateway-common.go @@ -346,7 +346,7 @@ func ErrorRespToObjectError(err error, params ...string) error { err = BucketNotEmpty{} case "NoSuchBucketPolicy": err = BucketPolicyNotFound{} - case "NoSuchBucketLifecycle": + case "NoSuchLifecycleConfiguration": err = BucketLifecycleNotFound{} case "InvalidBucketName": err = BucketNameInvalid{Bucket: bucket}