Skip to content

Commit

Permalink
bf(CLDSRV-413): Set isNull in objectMD fin backbeat putMetadata route…
Browse files Browse the repository at this point in the history
… for current null versions
  • Loading branch information
tmacro committed Aug 17, 2023
1 parent 656ef3f commit 2926048
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/routes/routeBackbeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,11 @@ function putMetadata(request, response, bucketInfo, objMd, log, callback) {
// Retrieve the null version id from the object metadata.
versionId = objMd && objMd.versionId;
if (!versionId) {
// Set isNull in the object metadata to be written.
// Since metadata will generate a versionId for the null version,
// the flag is needed to allow cloudserver to know that the version
// is a null version and allow access to it using the "null" versionId.
omVal.isNull = true;
if (versioning) {
// If the null version does not have a version id, it is a current null version.
// To update the metadata of a current version, versioning is set to false.
Expand All @@ -501,7 +506,6 @@ function putMetadata(request, response, bucketInfo, objMd, log, callback) {
// In such scenarios, we generate a new null version and designate it as the master version.
if (versioningConf && versioningConf.Status === 'Suspended') {
versionId = '';
omVal.isNull = true;
}
}
}
Expand Down

0 comments on commit 2926048

Please sign in to comment.