From 9da0b405db31583514e47ea43a9fb191339b3f97 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 29 Aug 2023 15:55:06 -0700 Subject: [PATCH] support all scanner events to be reported for excessive versions (#4672) --- cmd/client-s3.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/client-s3.go b/cmd/client-s3.go index b988914c..bca872f9 100644 --- a/cmd/client-s3.go +++ b/cmd/client-s3.go @@ -297,6 +297,9 @@ func (c *S3Client) AddNotificationConfig(ctx context.Context, arn string, events case "ilm": nc.AddEvents(notification.EventType("s3:ObjectRestore:*")) nc.AddEvents(notification.EventType("s3:ObjectTransition:*")) + case "scanner": + nc.AddEvents(notification.EventType("s3:Scanner:ManyVersions")) + nc.AddEvents(notification.EventType("s3:Scanner:BigPrefix")) default: return errInvalidArgument().Trace(events...) } @@ -375,6 +378,9 @@ func (c *S3Client) RemoveNotificationConfig(ctx context.Context, arn, event, pre case "ilm": eventsTyped = append(eventsTyped, notification.EventType("s3:ObjectRestore:*")) eventsTyped = append(eventsTyped, notification.EventType("s3:ObjectTransition:*")) + case "scanner": + eventsTyped = append(eventsTyped, notification.EventType("s3:Scanner:ManyVersions")) + eventsTyped = append(eventsTyped, notification.EventType("s3:Scanner:BigPrefix")) default: return errInvalidArgument().Trace(events...) } @@ -785,6 +791,8 @@ func (c *S3Client) Watch(ctx context.Context, options WatchOptions) (*WatchObjec events = append(events, string(notification.BucketCreatedAll)) case "bucket-removal": events = append(events, string(notification.BucketRemovedAll)) + case "scanner": + events = append(events, "s3:Scanner:ManyVersions", "s3:Scanner:BigPrefix") default: return nil, errInvalidArgument().Trace(event) }