Return Mock on GetBucketRequestPayment
#8924
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe the Problem
Currently, we fail the request of
GetBucketRequestPayment
withInternalError
although in our current code we have implemented returning a mock. In the case ofPutBucketRequestPayment
instead ofInternalError
it would beNotImplemented
.Explain the Changes
GetBucketRequestPayment
and add a log printing so we will not fail the request, also add a test for the mock in containerized and NC.PutBucketRequestPayment
in the same way.Issues:
GetBucketRequestPayment
(on the master branch):GetBucketRequestPayment
(on the master branch):Testing Instructions:
Unit tests:
Please run:
(NC):
sudo NC_CORETEST=true node ./node_modules/mocha/bin/mocha ./src/test/unit_tests/test_nsfs_integration.js
(Containerized):
Use this guide for local run and run: ./node_modules/mocha/bin/mocha.js src/test/unit_tests/test_s3_ops.js NOOBAA_LOG_LEVEL=all
Manual Testing instruction (NC deployment):
sudo node src/cmd/manage_nsfs account add --name <account-name> --new_buckets_path /Users/buckets/ --access_key <access-key> --secret_key <secret-key> --uid <uid> --gid <gid>
Note: before creating the account need to give permission to the
new_buckets_path
:chmod 777 /Users/buckets/
sudo node src/cmd/nsfs --debug 5
alias nc-user-1-s3=‘AWS_ACCESS_KEY_ID=<access-key> AWS_SECRET_ACCESS_KEY=<secret-key> aws --no-verify-ssl --endpoint-url https://localhost:6443’
nc-user-1-s3 s3 ls; echo $?
nc-user-1-s3 s3 mb s3://bucket-01-04
(bucket-01-04
is the bucket name in this example)nc-user-1-s3 s3api get-bucket-request-payment --bucket bucket-01-04
InternalError
- but from the s3ops layer):nc-user-1-s3 s3api put-bucket-request-payment --bucket bucket-01-04 --request-payment-configuration '{"Payer":"Requester"}'