mirror of https://github.com/minio/minio.git
fix: site replication bucket heal to not panic if replication config is missing (#15025)
This commit is contained in:
parent
197d6fb644
commit
29edb4ccfe
|
@ -3991,14 +3991,21 @@ func (c *SiteReplicationSys) healBucketReplicationConfig(ctx context.Context, ob
|
|||
}
|
||||
rcfg, _, err := globalBucketMetadataSys.GetReplicationConfig(ctx, bucket)
|
||||
if err != nil {
|
||||
_, ok := err.(BucketReplicationConfigNotFound)
|
||||
if !ok {
|
||||
return err
|
||||
}
|
||||
replMismatch = true
|
||||
}
|
||||
|
||||
if rcfg != nil {
|
||||
// validate remote targets on current cluster for this bucket
|
||||
_, apiErr := validateReplicationDestination(ctx, bucket, rcfg, false)
|
||||
if apiErr != noError {
|
||||
replMismatch = true
|
||||
}
|
||||
}
|
||||
|
||||
if replMismatch {
|
||||
err := c.PeerBucketConfigureReplHandler(ctx, bucket)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue