Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate error in switch case #7381

Merged
merged 1 commit into from Mar 20, 2019
Merged

Conversation

poornas
Copy link
Contributor

@poornas poornas commented Mar 17, 2019

Fixes: #7380. crypto.ErrInvalidCustomerKey was being handled twice
in toAPIErrorCode()

Description

Motivation and Context

Regression

No

How Has This Been Tested?

code clean up - no effect on behavior

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added unit tests to cover my changes.
  • I have added/updated functional tests in mint. (If yes, add mint PR # here: )
  • All new and existing tests passed.

@nitisht nitisht requested review from nitisht, kannappanr and aead and removed request for nitisht March 17, 2019 15:44
aead
aead previously approved these changes Mar 17, 2019
@kannappanr
Copy link
Contributor

Removed code returned ErrInvalidSSECustomerKey
https://github.com/minio/minio/pull/7381/files#diff-eaa76c8b99d35608df6c97893671a8d1L1510
while the other one will return ErrAccessDenied https://github.com/minio/minio/pull/7381/files#diff-eaa76c8b99d35608df6c97893671a8d1L1524

Are these return values same? or is it appropriate to return ErrAccessDenied in this scenario?

@kannappanr
Copy link
Contributor

Removed code returned ErrInvalidSSECustomerKey
https://github.com/minio/minio/pull/7381/files#diff-eaa76c8b99d35608df6c97893671a8d1L1510
while the other one will return ErrAccessDenied https://github.com/minio/minio/pull/7381/files#diff-eaa76c8b99d35608df6c97893671a8d1L1524

Are these return values same? or is it appropriate to return ErrAccessDenied in this scenario?

Both seem to be returning the same response back to the caller, so it doesn't matter which one gets removed.

@codecov
Copy link

codecov bot commented Mar 19, 2019

Codecov Report

Merging #7381 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7381      +/-   ##
==========================================
+ Coverage   48.06%   48.08%   +0.01%     
==========================================
  Files         297      297              
  Lines       46809    46807       -2     
==========================================
+ Hits        22499    22506       +7     
+ Misses      22248    22241       -7     
+ Partials     2062     2060       -2
Impacted Files Coverage Δ
cmd/api-errors.go 51.05% <ø> (+0.42%) ⬆️
cmd/posix.go 64.04% <0%> (+0.21%) ⬆️
cmd/os-reliable.go 67.67% <0%> (+2.02%) ⬆️
cmd/bitrot-streaming.go 81.55% <0%> (+2.91%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6bc0de2...cfdae44. Read the comment docs.

kannappanr
kannappanr previously approved these changes Mar 19, 2019
Copy link
Contributor

@kannappanr kannappanr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

aead
aead previously approved these changes Mar 19, 2019
Fixes: minio#7380. crypto.ErrInvalidCustomerKey was being handled twice
in toAPIErrorCode()
@minio-ops
Copy link

Mint Automation

Test Result
mint-compression-xl.sh ✔️
mint-large-bucket.sh ✔️
mint-compression-dist-xl.sh ✔️
mint-compression-fs.sh ✔️
mint-worm.sh ✔️
mint-fs.sh ✔️
mint-dist-xl.sh ✔️
mint-gateway-nas.sh ✔️
mint-xl.sh more...

7381-84b4e54/mint-xl.sh.log:

Running with
SERVER_ENDPOINT:      72.28.97.61:31593
ACCESS_KEY:           minio
SECRET_KEY:           ***REDACTED***
ENABLE_HTTPS:         0
SERVER_REGION:        us-east-1
MINT_DATA_DIR:        /mint/data
MINT_MODE:            full
ENABLE_VIRTUAL_STYLE: 0

To get logs, run 'docker cp 68ba4b641c08:/mint/log /tmp/mint-logs'

(1/14) Running aws-sdk-go tests ... done in 1 seconds
(2/14) Running aws-sdk-java tests ... done in 1 seconds
(3/14) Running aws-sdk-php tests ... done in 43 seconds
(4/14) Running aws-sdk-ruby tests ... done in 2 seconds
(5/14) Running awscli tests ... done in 47 seconds
(6/14) Running healthcheck tests ... done in 1 seconds
(7/14) Running mc tests ... done in 15 seconds
(8/14) Running minio-dotnet tests ... done in 27 seconds
(9/14) Running minio-go tests ... done in 40 seconds
(10/14) Running minio-java tests ... done in 1 minutes and 58 seconds
(11/14) Running minio-js tests ... done in 37 seconds
(12/14) Running minio-py tests ... FAILED in 2 minutes and 56 seconds
{
  "name": "minio-py:test_presigned_get_object_expiry_5sec",
  "function": "presigned_get_object(bucket_name, object_name, expires, response_headers, request_date)",
  "args": {
    "object_name": "3fc5f2c6-7adb-4ca8-aa40-788cb1e15e09",
    "bucket_name": "minio-py-test-9c68a834-97eb-4abf-96c8-6f0e4b1c9344"
  },
  "status": "FAIL",
  "duration": 145,
  "message": "AccessDenied: message: Access Denied",
  "error": "Traceback (most recent call last):\n  File \"/mint/run/core/minio-py/tests.py\", line 1220, in test_presigned_get_object_expiry_5sec\n    object_name).get_exception()\nminio.error.AccessDenied: AccessDenied: message: Access Denied\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File \"/mint/run/core/minio-py/tests.py\", line 1885, in main\n    test_presigned_get_object_expiry_5sec(client, log_output)\n  File \"/mint/run/core/minio-py/tests.py\", line 1228, in test_presigned_get_object_expiry_5sec\n    raise Exception(err)\nException: AccessDenied: message: Access Denied\n"
}

Executed 11 out of 14 tests successfully.

Copy link
Contributor

@kannappanr kannappanr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kannappanr kannappanr merged commit 12b79d9 into minio:master Mar 20, 2019
@poornas poornas deleted the apierr branch June 13, 2022 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cases in switch are equal
4 participants