NC | NSFS | Fix Bug | Head Object on a Tagged Object Does Not Return x-amz-tagging-count
Header
#8357
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.
Explain the changes
namespace_fs
returntag_count
which is the sum of all the extended attribute that has the prefixuser.noobaa.tag.
.XATTR_NOOBAA_CUSTOM_PREFIX
toXATTR_TAG
and move the variable declaration to a lower place in the variable declaration list.Issues: Fixed #8353
namespace_fs
we always returntag_count: 0
, therefore the client would not receive thex-amz-tagging-count
header.Testing Instructions:
Automatic Test
Please run:
s3tests_boto3/functional/test_s3.py::test_get_obj_head_tagging
in NC deployment.Manual Test
sudo node src/cmd/manage_nsfs account add --name <account-name> --new_buckets_path /tmp/nsfs_root1 --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 /tmp/nsfs_root1
,chmod 777 /tmp/nsfs_root2
.sudo node src/cmd/nsfs --debug 5
Notes:
config.NSFS_CHECK_BUCKET_BOUNDARIES = false; //SDSD
because I’m using the/tmp/
and not/private/tmp/
.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-1
(bucket-1
is the bucket name in this example)nc-user-1-s3 s3api put-object --bucket bucket-1 --key hello.txt
nc-user-1-s3 s3api put-object-tagging --tagging '{"TagSet": [{ "Key": "designation", "Value": "confidential" }, { "Key": "department", "Value": "finance" }, { "Key": "team", "Value": "payroll" } ]}' --bucket bucket-1 --key hello.txt
(in this example there are 3 added tags).nc-user-1-s3 s3api get-object --bucket bucket-1 --key hello.txt --debug
(use thedebug
flag to validate the header of `x-amz-tagging-count, expected to see 3).