File tree 1 file changed +8
-5
lines changed
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
146
146
}
147
147
148
148
// 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 ]
151
154
}
152
155
153
156
// 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 ) {
156
159
log .Error (nil , "Update event has no old object to update" , "event" , e )
157
160
return false
158
161
}
159
- if e .ObjectNew == nil {
162
+ if isNil ( e .ObjectNew ) {
160
163
log .Error (nil , "Update event has no new object to update" , "event" , e )
161
164
return false
162
165
}
You can’t perform that action at this time.
0 commit comments