fix: crash in hard quota enforcement (#13403)

due to data structure change after multi-site
replication, hard quota was broken due to
data structure change.

This PR fixes this.
This commit is contained in:
Harshavardhana 2021-10-11 11:03:54 -07:00 committed by GitHub
parent 9f652708ee
commit 02c24a860d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -89,7 +89,10 @@ func (sys *BucketQuotaSys) check(ctx context.Context, bucket string, size int64)
return err
}
dui := v.(madmin.DataUsageInfo)
dui, ok := v.(DataUsageInfo)
if !ok {
return fmt.Errorf("internal error: Unexpected DUI data type: %T", v)
}
bui, ok := dui.BucketsUsage[bucket]
if !ok {