From c103c72f0c67b52fdeeaa90d2e866c91b53c38fd Mon Sep 17 00:00:00 2001
From: Artem Torubarov
Date: Mon, 8 Dec 2025 11:08:24 +0100
Subject: [PATCH] rgw: support all S3 notification events in CRD validation
Signed-off-by: Artem Torubarov
(cherry picked from commit 7ee062bc06cf1a9fdd90042c7d0af39c80959310)
---
Documentation/CRDs/specification.md | 3 ++-
.../charts/rook-ceph/templates/resources.yaml | 26 ++++++++++++++++++-
deploy/examples/crds.yaml | 26 ++++++++++++++++++-
pkg/apis/ceph.rook.io/v1/types.go | 3 ++-
4 files changed, 54 insertions(+), 4 deletions(-)
diff --git a/Documentation/CRDs/specification.md b/Documentation/CRDs/specification.md
index ee93f9065..97d72ddf1 100644
--- a/Documentation/CRDs/specification.md
+++ b/Documentation/CRDs/specification.md
@@ -2854,7 +2854,8 @@ KeystoneSpec
(Appears on:BucketNotificationSpec)
BucketNotificationSpec
diff --git a/deploy/charts/rook-ceph/templates/resources.yaml b/deploy/charts/rook-ceph/templates/resources.yaml
index 797d3e7a3..aee9b85b3 100644
--- a/deploy/charts/rook-ceph/templates/resources.yaml
+++ b/deploy/charts/rook-ceph/templates/resources.yaml
@@ -932,7 +932,9 @@ spec:
events:
description: List of events that should trigger the notification
items:
- description: BucketNotificationSpec represent the event type of the bucket notification
+ description: |-
+ BucketNotificationSpec represent the event type of the bucket notification
+ See: https://docs.ceph.com/en/latest/radosgw/s3-notification-compatibility/#event-types
enum:
- s3:ObjectCreated:*
- s3:ObjectCreated:Put
@@ -942,6 +944,28 @@ spec:
- s3:ObjectRemoved:*
- s3:ObjectRemoved:Delete
- s3:ObjectRemoved:DeleteMarkerCreated
+ - s3:ObjectLifecycle:Expiration:Current
+ - s3:ObjectLifecycle:Expiration:NonCurrent
+ - s3:ObjectLifecycle:Expiration:DeleteMarker
+ - s3:ObjectLifecycle:Expiration:AbortMultipartUpload
+ - s3:ObjectLifecycle:Transition:Current
+ - s3:ObjectLifecycle:Transition:NonCurrent
+ - s3:LifecycleExpiration:*
+ - s3:LifecycleExpiration:Delete
+ - s3:LifecycleExpiration:DeleteMarkerCreated
+ - s3:LifecycleTransition
+ - s3:ObjectSynced:*
+ - s3:ObjectSynced:Create
+ - s3:ObjectSynced:Delete
+ - s3:ObjectSynced:DeletionMarkerCreated
+ - s3:Replication:*
+ - s3:Replication:Create
+ - s3:Replication:Delete
+ - s3:Replication:DeletionMarkerCreated
+ - s3:ObjectRestore:*
+ - s3:ObjectRestore:Post
+ - s3:ObjectRestore:Completed
+ - s3:ObjectRestore:Delete
type: string
type: array
filter:
diff --git a/deploy/examples/crds.yaml b/deploy/examples/crds.yaml
index 8f6c0684f..cbda4298a 100644
--- a/deploy/examples/crds.yaml
+++ b/deploy/examples/crds.yaml
@@ -933,7 +933,9 @@ spec:
events:
description: List of events that should trigger the notification
items:
- description: BucketNotificationSpec represent the event type of the bucket notification
+ description: |-
+ BucketNotificationSpec represent the event type of the bucket notification
+ See: https://docs.ceph.com/en/latest/radosgw/s3-notification-compatibility/#event-types
enum:
- s3:ObjectCreated:*
- s3:ObjectCreated:Put
@@ -943,6 +945,28 @@ spec:
- s3:ObjectRemoved:*
- s3:ObjectRemoved:Delete
- s3:ObjectRemoved:DeleteMarkerCreated
+ - s3:ObjectLifecycle:Expiration:Current
+ - s3:ObjectLifecycle:Expiration:NonCurrent
+ - s3:ObjectLifecycle:Expiration:DeleteMarker
+ - s3:ObjectLifecycle:Expiration:AbortMultipartUpload
+ - s3:ObjectLifecycle:Transition:Current
+ - s3:ObjectLifecycle:Transition:NonCurrent
+ - s3:LifecycleExpiration:*
+ - s3:LifecycleExpiration:Delete
+ - s3:LifecycleExpiration:DeleteMarkerCreated
+ - s3:LifecycleTransition
+ - s3:ObjectSynced:*
+ - s3:ObjectSynced:Create
+ - s3:ObjectSynced:Delete
+ - s3:ObjectSynced:DeletionMarkerCreated
+ - s3:Replication:*
+ - s3:Replication:Create
+ - s3:Replication:Delete
+ - s3:Replication:DeletionMarkerCreated
+ - s3:ObjectRestore:*
+ - s3:ObjectRestore:Post
+ - s3:ObjectRestore:Completed
+ - s3:ObjectRestore:Delete
type: string
type: array
filter:
diff --git a/pkg/apis/ceph.rook.io/v1/types.go b/pkg/apis/ceph.rook.io/v1/types.go
index 1a6183460..b3d850137 100755
--- a/pkg/apis/ceph.rook.io/v1/types.go
+++ b/pkg/apis/ceph.rook.io/v1/types.go
@@ -2659,7 +2659,8 @@ type CephBucketNotificationList struct {
}
// BucketNotificationSpec represent the event type of the bucket notification
-// +kubebuilder:validation:Enum="s3:ObjectCreated:*";"s3:ObjectCreated:Put";"s3:ObjectCreated:Post";"s3:ObjectCreated:Copy";"s3:ObjectCreated:CompleteMultipartUpload";"s3:ObjectRemoved:*";"s3:ObjectRemoved:Delete";"s3:ObjectRemoved:DeleteMarkerCreated"
+// See: https://docs.ceph.com/en/latest/radosgw/s3-notification-compatibility/#event-types
+// +kubebuilder:validation:Enum="s3:ObjectCreated:*";"s3:ObjectCreated:Put";"s3:ObjectCreated:Post";"s3:ObjectCreated:Copy";"s3:ObjectCreated:CompleteMultipartUpload";"s3:ObjectRemoved:*";"s3:ObjectRemoved:Delete";"s3:ObjectRemoved:DeleteMarkerCreated";"s3:ObjectLifecycle:Expiration:Current";"s3:ObjectLifecycle:Expiration:NonCurrent";"s3:ObjectLifecycle:Expiration:DeleteMarker";"s3:ObjectLifecycle:Expiration:AbortMultipartUpload";"s3:ObjectLifecycle:Transition:Current";"s3:ObjectLifecycle:Transition:NonCurrent";"s3:LifecycleExpiration:*";"s3:LifecycleExpiration:Delete";"s3:LifecycleExpiration:DeleteMarkerCreated";"s3:LifecycleTransition";"s3:ObjectSynced:*";"s3:ObjectSynced:Create";"s3:ObjectSynced:Delete";"s3:ObjectSynced:DeletionMarkerCreated";"s3:Replication:*";"s3:Replication:Create";"s3:Replication:Delete";"s3:Replication:DeletionMarkerCreated";"s3:ObjectRestore:*";"s3:ObjectRestore:Post";"s3:ObjectRestore:Completed";"s3:ObjectRestore:Delete"
type BucketNotificationEvent string
// BucketNotificationSpec represent the spec of a Bucket Notification