mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Disallow deletion of ARN when under active replication (#14972)
fixes a regression from #12880
This commit is contained in:
@@ -124,6 +124,7 @@ const (
|
||||
HealReplicationType
|
||||
ExistingObjectReplicationType
|
||||
ResyncReplicationType
|
||||
AllReplicationType
|
||||
)
|
||||
|
||||
// Valid returns true if replication type is set
|
||||
@@ -148,7 +149,7 @@ type ObjectOpts struct {
|
||||
// FilterActionableRules returns the rules actions that need to be executed
|
||||
// after evaluating prefix/tag filtering
|
||||
func (c Config) FilterActionableRules(obj ObjectOpts) []Rule {
|
||||
if obj.Name == "" && obj.OpType != ResyncReplicationType {
|
||||
if obj.Name == "" && !(obj.OpType == ResyncReplicationType || obj.OpType == AllReplicationType) {
|
||||
return nil
|
||||
}
|
||||
var rules []Rule
|
||||
@@ -160,8 +161,8 @@ func (c Config) FilterActionableRules(obj ObjectOpts) []Rule {
|
||||
if obj.TargetArn != "" && rule.Destination.ARN != obj.TargetArn && c.RoleArn != obj.TargetArn {
|
||||
continue
|
||||
}
|
||||
// Ignore other object level and prefix filters for resyncing target
|
||||
if obj.OpType == ResyncReplicationType {
|
||||
// Ignore other object level and prefix filters for resyncing target/listing bucket targets
|
||||
if obj.OpType == ResyncReplicationType || obj.OpType == AllReplicationType {
|
||||
rules = append(rules, rule)
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user