HealBucket: create the bucket if it is missing in one of the disks. (#2924)

This commit is contained in:
Krishna Srinivas
2016-10-14 23:42:17 +05:30
committed by Harshavardhana
parent 3349153058
commit 0320a77dc0
4 changed files with 56 additions and 0 deletions

View File

@@ -226,6 +226,11 @@ func (xl xlObjects) HealObject(bucket, object string) error {
if !IsValidBucketName(bucket) {
return traceError(BucketNameInvalid{Bucket: bucket})
}
if object == "" {
// Empty object name indicates that bucket should be healed.
return healBucket(xl.storageDisks, bucket)
}
// Verify if object is valid.
if !IsValidObjectName(object) {
// FIXME: return Invalid prefix.