@@ -55,6 +55,8 @@ type TestRequest struct {
5555 Key string
5656}
5757
58+ const testControllerName = "testcontroller"
59+
5860var _ = Describe ("controller" , func () {
5961 var fakeReconcile * fakeReconciler
6062 var ctrl * Controller [reconcile.Request ]
@@ -176,7 +178,7 @@ var _ = Describe("controller", func() {
176178 ctrl .startWatches = []source.TypedSource [reconcile.Request ]{
177179 source .Kind (c , & appsv1.Deployment {}, & handler.TypedEnqueueRequestForObject [* appsv1.Deployment ]{}),
178180 }
179- ctrl .Name = "testcontroller"
181+ ctrl .Name = testControllerName
180182
181183 err = ctrl .Start (context .TODO ())
182184 Expect (err ).To (HaveOccurred ())
@@ -196,7 +198,7 @@ var _ = Describe("controller", func() {
196198 cacheSyncDone : sourceSynced ,
197199 },
198200 }
199- ctrl .Name = "testcontroller"
201+ ctrl .Name = testControllerName
200202
201203 ctx , cancel := context .WithCancel (context .TODO ())
202204 go func () {
@@ -1148,12 +1150,12 @@ var _ = Describe("controller", func() {
11481150 ctrl .startWatches = []source.TypedSource [reconcile.Request ]{
11491151 source .Kind (& informertest.FakeInformers {Synced : ptr .To (false )}, & corev1.Pod {}, & handler.TypedEnqueueRequestForObject [* corev1.Pod ]{}),
11501152 }
1151- ctrl .Name = "foo"
1153+ ctrl .Name = testControllerName
11521154 ctx , cancel := context .WithCancel (context .Background ())
11531155 defer cancel ()
11541156 err := ctrl .Warmup (ctx )
11551157 Expect (err ).To (HaveOccurred ())
1156- Expect (err .Error ()).To (ContainSubstring ("failed to wait for foo caches to sync" ))
1158+ Expect (err .Error ()).To (ContainSubstring ("failed to wait for testcontroller caches to sync" ))
11571159 })
11581160
11591161 It ("should error when cache sync timeout occurs" , func () {
@@ -1165,7 +1167,7 @@ var _ = Describe("controller", func() {
11651167 ctrl .startWatches = []source.TypedSource [reconcile.Request ]{
11661168 source .Kind (c , & appsv1.Deployment {}, & handler.TypedEnqueueRequestForObject [* appsv1.Deployment ]{}),
11671169 }
1168- ctrl .Name = "testcontroller"
1170+ ctrl .Name = testControllerName
11691171
11701172 err = ctrl .Warmup (context .TODO ())
11711173 Expect (err ).To (HaveOccurred ())
@@ -1185,7 +1187,7 @@ var _ = Describe("controller", func() {
11851187 cacheSyncDone : sourceSynced ,
11861188 },
11871189 }
1188- ctrl .Name = "testcontroller"
1190+ ctrl .Name = testControllerName
11891191
11901192 ctx , cancel := context .WithCancel (context .TODO ())
11911193 go func () {
0 commit comments