File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -146,17 +146,20 @@ func NewTypedPredicateFuncs[object any](filter func(object object) bool) TypedFu
146146}
147147
148148// ResourceVersionChangedPredicate implements a default update predicate function on resource version change.
149- type ResourceVersionChangedPredicate struct {
150- Funcs
149+ type ResourceVersionChangedPredicate = TypedResourceVersionChangedPredicate [client.Object ]
150+
151+ // TypedResourceVersionChangedPredicate implements a default update predicate function on resource version change.
152+ type TypedResourceVersionChangedPredicate [T metav1.Object ] struct {
153+ TypedFuncs [T ]
151154}
152155
153156// Update implements default UpdateEvent filter for validating resource version change.
154- func (ResourceVersionChangedPredicate ) Update (e event.UpdateEvent ) bool {
155- if e .ObjectOld == nil {
157+ func (TypedResourceVersionChangedPredicate [ T ] ) Update (e event.TypedUpdateEvent [ T ] ) bool {
158+ if isNil ( e .ObjectOld ) {
156159 log .Error (nil , "Update event has no old object to update" , "event" , e )
157160 return false
158161 }
159- if e .ObjectNew == nil {
162+ if isNil ( e .ObjectNew ) {
160163 log .Error (nil , "Update event has no new object to update" , "event" , e )
161164 return false
162165 }
You can’t perform that action at this time.
0 commit comments