support all scanner events to be reported for excessive versions (#4672)

This commit is contained in:
Harshavardhana
2023-08-29 15:55:06 -07:00
committed by GitHub
parent 38d4108458
commit 9da0b405db
+8
View File
@@ -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)
}