mirror of
https://github.com/minio/minio.git
synced 2026-11-03 16:25:32 +00: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:
1 parent
fd02492cb7
commit
48e367ff7d
8 files changed
+519
-383
No files matched your search
@@ -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