mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
Fixed transition rules getting overwritten while healing (#18542)
While healing the latest changes of expiry rules across sites if target had pre existing transition rules, they were getting overwritten as cloned latest expiry rules from remote site were getting written as is. Fixed the same and added test cases as well. Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
This commit is contained in:
@@ -6095,8 +6095,11 @@ func mergeWithCurrentLCConfig(ctx context.Context, bucket string, expLCCfg *stri
|
||||
// else simply add to the map. This may happen if ILM expiry replication
|
||||
// was disabled for sometime and rules were updated independently in different
|
||||
// sites. Latest changes would get applied but merge only the non transition details
|
||||
if _, ok := rMap[id]; ok {
|
||||
rMap[id] = rl.CloneNonTransition()
|
||||
if existingRl, ok := rMap[id]; ok {
|
||||
clonedRl := rl.CloneNonTransition()
|
||||
clonedRl.Transition = existingRl.Transition
|
||||
clonedRl.NoncurrentVersionTransition = existingRl.NoncurrentVersionTransition
|
||||
rMap[id] = clonedRl
|
||||
} else {
|
||||
rMap[id] = rl
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user