Skip to content

Commit 9eb205c

Browse files
authored
Mirror should delete on delete marker creation + ILM (#5148)
Fixes #5147
1 parent 0ba848a commit 9eb205c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cmd/mirror-main.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,13 @@ func (m mirrorMessage) String() string {
297297
if m.EventTime != "" {
298298
msg = console.Colorize("Time", fmt.Sprintf("[%s] ", m.EventTime))
299299
}
300-
if m.EventType == notification.ObjectRemovedDelete {
300+
switch m.EventType {
301+
case notification.ObjectRemovedDelete:
301302
return msg + "Removed " + console.Colorize("Removed", fmt.Sprintf("`%s`", m.Target))
303+
case notification.ObjectRemovedDeleteMarkerCreated:
304+
return msg + "Removed (Delete Marker)" + console.Colorize("Removed", fmt.Sprintf("`%s`", m.Target))
305+
case notification.ILMDelMarkerExpirationDelete:
306+
return msg + "Removed (ILM)" + console.Colorize("Removed", fmt.Sprintf("`%s`", m.Target))
302307
}
303308
if m.EventTime == "" {
304309
return console.Colorize("Mirror", fmt.Sprintf("`%s` -> `%s`", m.Source, m.Target))
@@ -722,7 +727,9 @@ func (mj *mirrorJob) watchMirrorEvents(ctx context.Context, events []EventInfo)
722727
mj.parallel.queueTask(func() URLs {
723728
return mj.doMirrorWatch(ctx, targetPath, tgtSSE, mirrorURL, event)
724729
}, mirrorURL.SourceContent.Size)
725-
} else if event.Type == notification.ObjectRemovedDelete {
730+
} else if event.Type == notification.ObjectRemovedDelete ||
731+
event.Type == notification.ObjectRemovedDeleteMarkerCreated ||
732+
event.Type == notification.ILMDelMarkerExpirationDelete {
726733
if targetAlias != "" && strings.Contains(event.UserAgent, uaMirrorAppName+":"+targetAlias) {
727734
// Ignore delete cascading delete events if cyclical.
728735
continue

0 commit comments

Comments
 (0)