mirror of
https://github.com/minio/minio.git
synced 2026-11-04 00:26:16 +00:00
improve validation for replication resync API (#15964)
This commit is contained in:
1 parent
6e4acf0504
commit
d765b89a63
2 files changed
+13
-4
No files matched your search
@@ -162,15 +162,18 @@ type ObjectOpts struct {
|
||||
}
|
||||
|
||||
// HasExistingObjectReplication returns true if any of the rule returns 'ExistingObjects' replication.
|
||||
func (c Config) HasExistingObjectReplication(arn string) bool {
|
||||
func (c Config) HasExistingObjectReplication(arn string) (hasARN, isEnabled bool) {
|
||||
for _, rule := range c.Rules {
|
||||
if rule.Destination.ARN == arn || c.RoleArn == arn {
|
||||
if !hasARN {
|
||||
hasARN = true
|
||||
}
|
||||
if rule.ExistingObjectReplication.Status == Enabled {
|
||||
return true
|
||||
return true, true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
return hasARN, false
|
||||
}
|
||||
|
||||
// FilterActionableRules returns the rules actions that need to be executed
|
||||
|
||||
Reference in new issue
Block a user