mirror of
https://github.com/minio/minio.git
synced 2025-11-29 05:19:03 -05:00
Adding XL Object layer validation for existing unit tests of single node (#1499)
object layer. Adding isBucketExist check for GetObjectInfo in the XL layer.
This commit is contained in:
committed by
Harshavardhana
parent
48d3be36da
commit
0b4bbe6d9e
@@ -159,6 +159,12 @@ func (xl xlObjects) GetObjectInfo(bucket, object string) (ObjectInfo, error) {
|
||||
if !IsValidObjectName(object) {
|
||||
return ObjectInfo{}, ObjectNameInvalid{Bucket: bucket, Object: object}
|
||||
}
|
||||
// Check whether the bucket exists.
|
||||
if isExist, err := isBucketExist(xl.storage, bucket); err != nil {
|
||||
return ObjectInfo{}, err
|
||||
} else if !isExist {
|
||||
return ObjectInfo{}, BucketNotFound{Bucket: bucket}
|
||||
}
|
||||
fi, err := xl.storage.StatFile(bucket, object)
|
||||
if err != nil {
|
||||
if err != errFileNotFound {
|
||||
|
||||
Reference in New Issue
Block a user