Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
rgw_sal_motr : [CORTX-32387] Fix null version-id issues in GET/HEAD o…
Browse files Browse the repository at this point in the history
…bject API (#377)

Problem: GET and HEAD object with null version-id does not contain "VersionId" field in the response

Solution: In GET/HEAD object with --version-id null parameter for simple and multipart object, set the ent.key.instance value as null to show the VersionId field in the response.

Signed-off-by: Priyanka Salunke <priyanka.s.salunke@seagate.com>
  • Loading branch information
priyanka25081999 authored Aug 5, 2022
1 parent 0f5b07d commit 7fa8943
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rgw/rgw_sal_motr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3181,6 +3181,11 @@ int MotrObject::get_bucket_dir_ent(const DoutPrefixProvider *dpp, rgw_bucket_dir
key.set(ent.key);
obj_key = key.name + '\a' + key.instance;

// Set the instance value as "null" to show
// the VersionId field in the GET/HEAD object response
if (this->get_key().have_null_instance())
ent.key.instance = "null";

// Put into the cache
this->store->get_obj_meta_cache()->put(dpp, obj_key, bl);

Expand Down

0 comments on commit 7fa8943

Please sign in to comment.