Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/agent/block_store_services/block_store_s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,19 @@ class BlockStoreS3 extends BlockStoreBase {
async test_store_validity() {
const block_key = this._block_key(`test-delete-non-existing-key-${Date.now()}`);
try {
// in s3 there is no error for non-existing object
await this.s3cloud.deleteObject({
Bucket: this.cloud_info.target_bucket,
Key: block_key
}).promise();
const endpoint = this.cloud_info.endpoint;
if (cloud_utils.is_aws_endpoint(endpoint)) {
// in s3 there is no error for non-existing object
await this.s3cloud.deleteObjectTagging({
Bucket: this.cloud_info.target_bucket,
Key: block_key
}).promise();
} else {
await this.s3cloud.deleteObject({
Bucket: this.cloud_info.target_bucket,
Key: block_key
}).promise();
}
} catch (err) {
dbg.error('in _test_cloud_service - deleteObject failed:', err, _.omit(this.cloud_info, 'access_keys'));
if (err.code === 'NoSuchBucket') {
Expand Down