fix: relax some replication validations (#10210)

Also inherit storage class from source object
if replication configuration does not have a storage
class specified for destination bucket.
This commit is contained in:
poornas
2020-08-05 20:01:20 -07:00
committed by GitHub
parent 195f95196e
commit 121164db56
4 changed files with 9 additions and 8 deletions

View File

@@ -145,11 +145,8 @@ func (c Config) FilterActionableRules(obj ObjectOpts) []Rule {
// GetDestination returns destination bucket and storage class.
func (c Config) GetDestination() Destination {
for _, rule := range c.Rules {
if rule.Status == Disabled {
continue
}
return rule.Destination
if len(c.Rules) > 0 {
return c.Rules[0].Destination
}
return Destination{}
}

View File

@@ -146,7 +146,7 @@ func (r Rule) Validate(bucket string, sameTarget bool) error {
if err := r.DeleteMarkerReplication.Validate(); err != nil {
return err
}
if r.Priority <= 0 {
if r.Priority < 0 {
return errPriorityMissing
}
if r.Destination.Bucket == bucket && sameTarget {