validate bucket before attempting batch replication (#15861)

This commit is contained in:
Harshavardhana
2022-10-15 11:58:31 -07:00
committed by GitHub
parent c79bcc8838
commit c68910005b
5 changed files with 80 additions and 2 deletions
+8 -1
View File
@@ -344,7 +344,14 @@ func (es *erasureSingle) GetBucketInfo(ctx context.Context, bucket string, opts
}
return bi, toObjectErr(err, bucket)
}
return BucketInfo{Name: volInfo.Name, Created: volInfo.Created}, nil
bi = BucketInfo{Name: volInfo.Name, Created: volInfo.Created}
meta, err := globalBucketMetadataSys.Get(bucket)
if err == nil {
bi.Created = meta.Created
bi.Versioning = meta.LockEnabled || globalBucketVersioningSys.Enabled(bucket)
bi.ObjectLocking = meta.LockEnabled
}
return bi, nil
}
// DeleteBucket - deletes a bucket.