Skip to content

Commit 34beb4c

Browse files
📖 clarify comments of GenerationChangedPredicate (#3002)
* clarify comments of GenerationChangedPredicate * fix: update comments of GenerationChangedPredicate about cr generation
1 parent 219b19c commit 34beb4c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/predicate/predicate.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ func (TypedResourceVersionChangedPredicate[T]) Update(e event.TypedUpdateEvent[T
173173
// The metadata.generation field of an object is incremented by the API server when writes are made to the spec field of an object.
174174
// This allows a controller to ignore update events where the spec is unchanged, and only the metadata and/or status fields are changed.
175175
//
176-
// For CustomResource objects the Generation is only incremented when the status subresource is enabled.
176+
// For CustomResource objects the Generation is incremented when spec is changed, or status changed and status not modeled as subresource.
177+
// subresource status update will not increase Generation.
177178
//
178179
// Caveats:
179180
//
@@ -191,7 +192,8 @@ type GenerationChangedPredicate = TypedGenerationChangedPredicate[client.Object]
191192
// The metadata.generation field of an object is incremented by the API server when writes are made to the spec field of an object.
192193
// This allows a controller to ignore update events where the spec is unchanged, and only the metadata and/or status fields are changed.
193194
//
194-
// For CustomResource objects the Generation is only incremented when the status subresource is enabled.
195+
// For CustomResource objects the Generation is incremented when spec is changed, or status changed and status not modeled as subresource.
196+
// subresource status update will not increase Generation.
195197
//
196198
// Caveats:
197199
//

0 commit comments

Comments
 (0)