Skip to content

Commit

Permalink
📖 clarify comments of GenerationChangedPredicate (#3002)
Browse files Browse the repository at this point in the history
* clarify comments of GenerationChangedPredicate

* fix: update comments of GenerationChangedPredicate about cr generation
  • Loading branch information
loveRhythm1990 authored Nov 4, 2024
1 parent 219b19c commit 34beb4c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/predicate/predicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ func (TypedResourceVersionChangedPredicate[T]) Update(e event.TypedUpdateEvent[T
// The metadata.generation field of an object is incremented by the API server when writes are made to the spec field of an object.
// This allows a controller to ignore update events where the spec is unchanged, and only the metadata and/or status fields are changed.
//
// For CustomResource objects the Generation is only incremented when the status subresource is enabled.
// For CustomResource objects the Generation is incremented when spec is changed, or status changed and status not modeled as subresource.
// subresource status update will not increase Generation.
//
// Caveats:
//
Expand All @@ -191,7 +192,8 @@ type GenerationChangedPredicate = TypedGenerationChangedPredicate[client.Object]
// The metadata.generation field of an object is incremented by the API server when writes are made to the spec field of an object.
// This allows a controller to ignore update events where the spec is unchanged, and only the metadata and/or status fields are changed.
//
// For CustomResource objects the Generation is only incremented when the status subresource is enabled.
// For CustomResource objects the Generation is incremented when spec is changed, or status changed and status not modeled as subresource.
// subresource status update will not increase Generation.
//
// Caveats:
//
Expand Down

0 comments on commit 34beb4c

Please sign in to comment.