@@ -76,7 +76,7 @@ var _ = Describe("Internal", func() {
76
76
set = true
77
77
},
78
78
}
79
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, funcs , nil )
79
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, funcs , nil )
80
80
})
81
81
82
82
Describe ("EventHandler" , func () {
@@ -101,38 +101,38 @@ var _ = Describe("Internal", func() {
101
101
})
102
102
103
103
It ("should used Predicates to filter CreateEvents" , func () {
104
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
104
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
105
105
predicate.Funcs {CreateFunc : func (event.CreateEvent ) bool { return false }},
106
106
})
107
107
set = false
108
108
instance .OnAdd (pod )
109
109
Expect (set ).To (BeFalse ())
110
110
111
111
set = false
112
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
112
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
113
113
predicate.Funcs {CreateFunc : func (event.CreateEvent ) bool { return true }},
114
114
})
115
115
instance .OnAdd (pod )
116
116
Expect (set ).To (BeTrue ())
117
117
118
118
set = false
119
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
119
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
120
120
predicate.Funcs {CreateFunc : func (event.CreateEvent ) bool { return true }},
121
121
predicate.Funcs {CreateFunc : func (event.CreateEvent ) bool { return false }},
122
122
})
123
123
instance .OnAdd (pod )
124
124
Expect (set ).To (BeFalse ())
125
125
126
126
set = false
127
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
127
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
128
128
predicate.Funcs {CreateFunc : func (event.CreateEvent ) bool { return false }},
129
129
predicate.Funcs {CreateFunc : func (event.CreateEvent ) bool { return true }},
130
130
})
131
131
instance .OnAdd (pod )
132
132
Expect (set ).To (BeFalse ())
133
133
134
134
set = false
135
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
135
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
136
136
predicate.Funcs {CreateFunc : func (event.CreateEvent ) bool { return true }},
137
137
predicate.Funcs {CreateFunc : func (event.CreateEvent ) bool { return true }},
138
138
})
@@ -159,37 +159,37 @@ var _ = Describe("Internal", func() {
159
159
160
160
It ("should used Predicates to filter UpdateEvents" , func () {
161
161
set = false
162
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
162
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
163
163
predicate.Funcs {UpdateFunc : func (updateEvent event.UpdateEvent ) bool { return false }},
164
164
})
165
165
instance .OnUpdate (pod , newPod )
166
166
Expect (set ).To (BeFalse ())
167
167
168
168
set = false
169
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
169
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
170
170
predicate.Funcs {UpdateFunc : func (event.UpdateEvent ) bool { return true }},
171
171
})
172
172
instance .OnUpdate (pod , newPod )
173
173
Expect (set ).To (BeTrue ())
174
174
175
175
set = false
176
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
176
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
177
177
predicate.Funcs {UpdateFunc : func (event.UpdateEvent ) bool { return true }},
178
178
predicate.Funcs {UpdateFunc : func (event.UpdateEvent ) bool { return false }},
179
179
})
180
180
instance .OnUpdate (pod , newPod )
181
181
Expect (set ).To (BeFalse ())
182
182
183
183
set = false
184
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
184
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
185
185
predicate.Funcs {UpdateFunc : func (event.UpdateEvent ) bool { return false }},
186
186
predicate.Funcs {UpdateFunc : func (event.UpdateEvent ) bool { return true }},
187
187
})
188
188
instance .OnUpdate (pod , newPod )
189
189
Expect (set ).To (BeFalse ())
190
190
191
191
set = false
192
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
192
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
193
193
predicate.Funcs {CreateFunc : func (event.CreateEvent ) bool { return true }},
194
194
predicate.Funcs {CreateFunc : func (event.CreateEvent ) bool { return true }},
195
195
})
@@ -217,37 +217,37 @@ var _ = Describe("Internal", func() {
217
217
218
218
It ("should used Predicates to filter DeleteEvents" , func () {
219
219
set = false
220
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
220
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
221
221
predicate.Funcs {DeleteFunc : func (event.DeleteEvent ) bool { return false }},
222
222
})
223
223
instance .OnDelete (pod )
224
224
Expect (set ).To (BeFalse ())
225
225
226
226
set = false
227
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
227
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
228
228
predicate.Funcs {DeleteFunc : func (event.DeleteEvent ) bool { return true }},
229
229
})
230
230
instance .OnDelete (pod )
231
231
Expect (set ).To (BeTrue ())
232
232
233
233
set = false
234
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
234
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
235
235
predicate.Funcs {DeleteFunc : func (event.DeleteEvent ) bool { return true }},
236
236
predicate.Funcs {DeleteFunc : func (event.DeleteEvent ) bool { return false }},
237
237
})
238
238
instance .OnDelete (pod )
239
239
Expect (set ).To (BeFalse ())
240
240
241
241
set = false
242
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
242
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
243
243
predicate.Funcs {DeleteFunc : func (event.DeleteEvent ) bool { return false }},
244
244
predicate.Funcs {DeleteFunc : func (event.DeleteEvent ) bool { return true }},
245
245
})
246
246
instance .OnDelete (pod )
247
247
Expect (set ).To (BeFalse ())
248
248
249
249
set = false
250
- instance = internal .NewEventHandler (ctx , & controllertest.Queue {}, setfuncs , []predicate.Predicate {
250
+ instance = internal .NewEventHandler (ctx , & controllertest.Queue {TypedInterface : workqueue . NewTyped [reconcile. Request ]() }, setfuncs , []predicate.Predicate {
251
251
predicate.Funcs {DeleteFunc : func (event.DeleteEvent ) bool { return true }},
252
252
predicate.Funcs {DeleteFunc : func (event.DeleteEvent ) bool { return true }},
253
253
})
0 commit comments