mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
reject resync start on misconfigured replication rules (#15041)
we expect resync to start on buckets with replication rule ExistingObjects enabled, if not we reject such calls.
This commit is contained in:
@@ -146,6 +146,18 @@ type ObjectOpts struct {
|
||||
TargetArn string
|
||||
}
|
||||
|
||||
// HasExistingObjectReplication returns true if any of the rule returns 'ExistingObjects' replication.
|
||||
func (c Config) HasExistingObjectReplication(arn string) bool {
|
||||
for _, rule := range c.Rules {
|
||||
if rule.Destination.ARN == arn || c.RoleArn == arn {
|
||||
if rule.ExistingObjectReplication.Status == Enabled {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// FilterActionableRules returns the rules actions that need to be executed
|
||||
// after evaluating prefix/tag filtering
|
||||
func (c Config) FilterActionableRules(obj ObjectOpts) []Rule {
|
||||
|
||||
Reference in New Issue
Block a user