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

Function createBucketWithReplication

tests/unit/api/objectReplicationMD.js:120–139  ·  view source on GitHub ↗
(hasStorageClass)

Source from the content-addressed store, hash-verified

118
119// Create the bucket in metadata with versioning and a replication config.
120function createBucketWithReplication(hasStorageClass) {
121 createBucket();
122 const config = {
123 role: 'arn:aws:iam::account-id:role/src-resource,' +
124 'arn:aws:iam::account-id:role/dest-resource',
125 destination: 'arn:aws:s3:::source-bucket',
126 rules: [{
127 prefix: keyA,
128 enabled: true,
129 id: 'test-id',
130 }],
131 };
132 if (hasStorageClass) {
133 config.rules[0].storageClass = storageClassType;
134 }
135 Object.assign(metadata.buckets.get(bucketName), {
136 _versioningConfiguration: { status: 'Enabled' },
137 _replicationConfiguration: config,
138 });
139}
140
141// Create the shadow bucket in metadata for MPUs with a recent model number.
142function createShadowBucket(key, uploadId) {

Callers 1

Calls 1

createBucketFunction · 0.70

Tested by

no test coverage detected