Skip to content

Commit 7365530

Browse files
authored
predicate: Remove duplicate object validation (#47)
Remove duplicate object validation from NoGenerationPredicate.
1 parent 8c3d48f commit 7365530

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

predicate/nogeneration.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ type NoGenerationPredicate struct {
5959

6060
// Update implements the default UpdateEvent filter for validating absence Generation.
6161
func (NoGenerationPredicate) Update(e event.UpdateEvent) bool {
62-
if e.ObjectOld == nil {
63-
log.V(1).Info("Update event has no old metadata", "event", e)
64-
return false
65-
}
6662
if e.ObjectOld == nil {
6763
log.V(1).Info("Update event has no old runtime object to update", "event", e)
6864
return false
@@ -71,10 +67,6 @@ func (NoGenerationPredicate) Update(e event.UpdateEvent) bool {
7167
log.V(1).Info("Update event has no new runtime object for update", "event", e)
7268
return false
7369
}
74-
if e.ObjectNew == nil {
75-
log.V(1).Info("Update event has no new metadata", "event", e)
76-
return false
77-
}
7870
// Since generation is monotonically increasing, the new generation will always be greater than the old
7971
// iff the object respects generations.
8072
return e.ObjectNew.GetGeneration() == e.ObjectOld.GetGeneration() && e.ObjectNew.GetGeneration() == 0

0 commit comments

Comments
 (0)