lib/api/apiUtils/bucket/bucketDeletion.js
// delete a bucket even if there are ongoing multipart uploads.
delete a bucket even if there are ongoing multipart uploads.
delete a bucket even if there are ongoing multipart uploads .
function deleteMPUbucketStep(next) {
            const MPUBucketName = `${constants.mpuBucketPrefix}${bucketName}`;
            return metadata.listObject(MPUBucketName,
                { maxKeys: 1 }, log, (err, objectsListRes) => {
                    if (err && err.NoSuchBucket) {
                        return next();
                    }
                    if (err) {
                        log.error('error from metadata', { error: err });
                        return next(err);
                    }
                    if (objectsListRes.Contents.length) {
                        log.debug('bucket delete failed',
                            { error: errors.MPUinProgress });
                        return next(errors.MPUinProgress);
                    }
                    log.trace('deleting shadow MPU bucket');
                    return _deleteMPUbucket(bucketName, log, next);
                });
        }
function deleteMPUbucketStep ( next ) { const MPUBucketName = ` ${ constants . mpuBucketPrefix } ${ bucketName } ` ; return metadata . listObject ( MPUBucketName , { maxKeys : 1 } , log , ( err , objectsListRes ) => { if ( err && err . NoSuchBucket ) { return next ( ) ; } if ( err ) { log . error ( 'error from metadata' , { error : err } ) ; return next ( err ) ; } if ( objectsListRes . Contents . length ) { log . debug ( 'bucket delete failed' , { error : errors . MPUinProgress } ) ; return next ( errors . MPUinProgress ) ; } log . trace ( 'deleting shadow MPU bucket' ) ; return _deleteMPUbucket ( bucketName , log , next ) ; } ) ; }
delete a bucket even if there are ongoing multipart uploads.
delete a bucket even if there are ongoing multipart uploads .
// If no shadow bucket ever created, no ongoing MPU's, so // continue with deletion // Return non-AWS standard error // regarding ongoing MPUs so user // understands what is occurring