Gargi-jais11 opened a new pull request, #10785:
URL: https://github.com/apache/ozone/pull/10785

   ## What changes were proposed in this pull request?
   s3-tests `test_object_set_get_metadata_*` fail with KeyError:'meta1'.
   PutObject stores custom metadata via **getCustomMetadataFromHeaders()**, and 
HeadObject returns it via **addCustomMetadataHeaders()**, but GetObject does 
not."
   
   - test_object_set_get_metadata_none_to_good
   - test_object_set_get_metadata_none_to_empty
   - test_object_set_get_metadata_overwrite_to_empty
   - test_object_set_get_unicode_metadata
   
   Fix:
   Added**addCustomMetadataHeaders()** to the GET response builder.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-15607
   
   ## How was this patch tested?
   
   Added IT and UT.
   **Before Fix:**
   ```
   bash-5.1$ aws s3api put-object \
     --bucket metatest \
     --key foo \
     --body /tmp/bar \
     --metadata meta1=mymeta \
     --endpoint-url http://s3g:9878
   {
       "ETag": "\"c157a79031e1c40f85931829bc5fc552\""
   }
   bash-5.1$ aws s3api get-object \
     --bucket metatest \
     --key foo \
     /tmp/out \
     --endpoint-url http://s3g:9878 \
     --query 'Metadata'
                   <------------------------- Didn't return the metadata tag
     
   bash-5.1$ aws s3api put-object \
     --bucket metatest \
     --key foo2 \
     --body /tmp/bar \
     --metadata meta1= \
     --endpoint-url http://s3g:9878
   {
       "ETag": "\"c157a79031e1c40f85931829bc5fc552\""
   }
   bash-5.1$ aws s3api get-object \
     --bucket metatest \
     --key foo2 \
     /tmp/out2 \
     --endpoint-url http://s3g:9878 \
     --query 'Metadata'
                    <------------------------- Didn't return the metadata tag
   
   ```
   
   **After Fix:**
   ```
   bash-5.1$ aws s3api put-object \
     --bucket metatest \
     --key foo \
     --body /tmp/bar \
     --metadata meta1=mymeta \
     --endpoint-url http://s3g:9878/
   {
       "ETag": "\"c157a79031e1c40f85931829bc5fc552\""
   }
   bash-5.1$ aws s3api get-object \
     --bucket metatest \
     --key foo \
     /tmp/out \
     --endpoint-url http://s3g:9878/ \
     --query 'Metadata'
   {
       "meta1": "mymeta"
   }
   bash-5.1$ aws s3api put-object \
     --bucket metatest \
     --key foo2 \
     --body /tmp/bar \
     --metadata meta1= \
     --endpoint-url http://s3g:9878/
   {
       "ETag": "\"c157a79031e1c40f85931829bc5fc552\""
   }
   bash-5.1$ aws s3api get-object \
     --bucket metatest \
     --key foo2 \
     /tmp/out2 \
     --endpoint-url http://s3g:9878/ \
     --query 'Metadata'
   {
       "meta1": ""
   }
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to