@@ -21,9 +21,9 @@ import (
2121 "sigs.k8s.io/controller-runtime/pkg/client"
2222 logf "sigs.k8s.io/controller-runtime/pkg/log"
2323
24+ eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1"
2425 "github.com/fluxcd/pkg/apis/meta"
2526 "github.com/fluxcd/pkg/runtime/conditions"
26- "github.com/fluxcd/pkg/runtime/events"
2727
2828 notifyv1 "github.com/fluxcd/notification-controller/api/v1beta1"
2929 "github.com/fluxcd/notification-controller/internal/server"
@@ -154,7 +154,7 @@ func TestEventHandler(t *testing.T) {
154154 return conditions .IsReady (& obj )
155155 }, 30 * time .Second , time .Second ).Should (BeTrue ())
156156
157- event := events .Event {
157+ event := eventv1 .Event {
158158 InvolvedObject : corev1.ObjectReference {
159159 Kind : "Bucket" ,
160160 Name : "hyacinth" ,
@@ -194,49 +194,49 @@ func TestEventHandler(t *testing.T) {
194194
195195 tests := []struct {
196196 name string
197- modifyEventFunc func (e events .Event ) events .Event
197+ modifyEventFunc func (e eventv1 .Event ) eventv1 .Event
198198 forwarded bool
199199 }{
200200 {
201201 name : "forwards when source is a match" ,
202- modifyEventFunc : func (e events .Event ) events .Event { return e },
202+ modifyEventFunc : func (e eventv1 .Event ) eventv1 .Event { return e },
203203 forwarded : true ,
204204 },
205205 {
206206 name : "drops event when source Kind does not match" ,
207- modifyEventFunc : func (e events .Event ) events .Event {
207+ modifyEventFunc : func (e eventv1 .Event ) eventv1 .Event {
208208 e .InvolvedObject .Kind = "GitRepository"
209209 return e
210210 },
211211 forwarded : false ,
212212 },
213213 {
214214 name : "drops event when source name does not match" ,
215- modifyEventFunc : func (e events .Event ) events .Event {
215+ modifyEventFunc : func (e eventv1 .Event ) eventv1 .Event {
216216 e .InvolvedObject .Name = "slop"
217217 return e
218218 },
219219 forwarded : false ,
220220 },
221221 {
222222 name : "drops event when source namespace does not match" ,
223- modifyEventFunc : func (e events .Event ) events .Event {
223+ modifyEventFunc : func (e eventv1 .Event ) eventv1 .Event {
224224 e .InvolvedObject .Namespace = "all-buckets"
225225 return e
226226 },
227227 forwarded : false ,
228228 },
229229 {
230230 name : "drops event that is matched by exclusion" ,
231- modifyEventFunc : func (e events .Event ) events .Event {
231+ modifyEventFunc : func (e eventv1 .Event ) eventv1 .Event {
232232 e .Message = "this is excluded"
233233 return e
234234 },
235235 forwarded : false ,
236236 },
237237 {
238238 name : "forwards events when name wildcard is used" ,
239- modifyEventFunc : func (e events .Event ) events .Event {
239+ modifyEventFunc : func (e eventv1 .Event ) eventv1 .Event {
240240 e .InvolvedObject .Kind = "Kustomization"
241241 e .InvolvedObject .Name = "test"
242242 e .InvolvedObject .Namespace = namespace
@@ -247,7 +247,7 @@ func TestEventHandler(t *testing.T) {
247247 },
248248 {
249249 name : "forwards events when the label matches" ,
250- modifyEventFunc : func (e events .Event ) events .Event {
250+ modifyEventFunc : func (e eventv1 .Event ) eventv1 .Event {
251251 e .InvolvedObject .Kind = "GitRepository"
252252 e .InvolvedObject .Name = "podinfo"
253253 e .InvolvedObject .APIVersion = "source.toolkit.fluxcd.io/v1beta1"
@@ -259,7 +259,7 @@ func TestEventHandler(t *testing.T) {
259259 },
260260 {
261261 name : "drops events when the labels don't match" ,
262- modifyEventFunc : func (e events .Event ) events .Event {
262+ modifyEventFunc : func (e eventv1 .Event ) eventv1 .Event {
263263 e .InvolvedObject .Kind = "GitRepository"
264264 e .InvolvedObject .Name = "podinfo-two"
265265 e .InvolvedObject .APIVersion = "source.toolkit.fluxcd.io/v1beta1"
@@ -271,7 +271,7 @@ func TestEventHandler(t *testing.T) {
271271 },
272272 {
273273 name : "drops events for cross-namespace sources" ,
274- modifyEventFunc : func (e events .Event ) events .Event {
274+ modifyEventFunc : func (e eventv1 .Event ) eventv1 .Event {
275275 e .InvolvedObject .Kind = "Kustomization"
276276 e .InvolvedObject .Name = "test"
277277 e .InvolvedObject .Namespace = "test"
0 commit comments