MCPcopy Index your code
hub / github.com/scality/cloudserver / _storeNullVersionMD

Function _storeNullVersionMD

lib/api/apiUtils/object/versioning.js:83–110  ·  view source on GitHub ↗
(bucketName, objKey, nullVersionId, objMD, log, cb)

Source from the content-addressed store, hash-verified

81}
82
83function _storeNullVersionMD(bucketName, objKey, nullVersionId, objMD, log, cb) {
84 // In compatibility mode, create null versioned keys instead of null keys
85 let versionId;
86 let nullVersionMD;
87 if (config.nullVersionCompatMode) {
88 versionId = nullVersionId;
89 nullVersionMD = Object.assign({}, objMD, {
90 versionId: nullVersionId,
91 isNull: true,
92 });
93 } else {
94 versionId = 'null';
95 nullVersionMD = Object.assign({}, objMD, {
96 versionId: nullVersionId,
97 isNull: true,
98 isNull2: true,
99 });
100 }
101 nullVersionMD.originOp = 's3:StoreNullVersion';
102 metadata.putObjectMD(bucketName, objKey, nullVersionMD, { versionId }, log, err => {
103 if (err) {
104 log.debug('error from metadata storing null version as new version',
105 { error: err });
106 }
107
108 cb(err);
109 });
110}
111
112/** check existence and get location of null version data for deletion
113* @param {string} bucketName - name of bucket

Callers 1

versioningPreprocessingFunction · 0.85

Calls 1

debugMethod · 0.80

Tested by

no test coverage detected