@@ -55,6 +55,8 @@ type TestRequest struct {
55
55
Key string
56
56
}
57
57
58
+ const testControllerName = "testcontroller"
59
+
58
60
var _ = Describe ("controller" , func () {
59
61
var fakeReconcile * fakeReconciler
60
62
var ctrl * Controller [reconcile.Request ]
@@ -176,7 +178,7 @@ var _ = Describe("controller", func() {
176
178
ctrl .startWatches = []source.TypedSource [reconcile.Request ]{
177
179
source .Kind (c , & appsv1.Deployment {}, & handler.TypedEnqueueRequestForObject [* appsv1.Deployment ]{}),
178
180
}
179
- ctrl .Name = "testcontroller"
181
+ ctrl .Name = testControllerName
180
182
181
183
err = ctrl .Start (context .TODO ())
182
184
Expect (err ).To (HaveOccurred ())
@@ -196,7 +198,7 @@ var _ = Describe("controller", func() {
196
198
cacheSyncDone : sourceSynced ,
197
199
},
198
200
}
199
- ctrl .Name = "testcontroller"
201
+ ctrl .Name = testControllerName
200
202
201
203
ctx , cancel := context .WithCancel (context .TODO ())
202
204
go func () {
@@ -1148,12 +1150,12 @@ var _ = Describe("controller", func() {
1148
1150
ctrl .startWatches = []source.TypedSource [reconcile.Request ]{
1149
1151
source .Kind (& informertest.FakeInformers {Synced : ptr .To (false )}, & corev1.Pod {}, & handler.TypedEnqueueRequestForObject [* corev1.Pod ]{}),
1150
1152
}
1151
- ctrl .Name = "foo"
1153
+ ctrl .Name = testControllerName
1152
1154
ctx , cancel := context .WithCancel (context .Background ())
1153
1155
defer cancel ()
1154
1156
err := ctrl .Warmup (ctx )
1155
1157
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" ))
1157
1159
})
1158
1160
1159
1161
It ("should error when cache sync timeout occurs" , func () {
@@ -1165,7 +1167,7 @@ var _ = Describe("controller", func() {
1165
1167
ctrl .startWatches = []source.TypedSource [reconcile.Request ]{
1166
1168
source .Kind (c , & appsv1.Deployment {}, & handler.TypedEnqueueRequestForObject [* appsv1.Deployment ]{}),
1167
1169
}
1168
- ctrl .Name = "testcontroller"
1170
+ ctrl .Name = testControllerName
1169
1171
1170
1172
err = ctrl .Warmup (context .TODO ())
1171
1173
Expect (err ).To (HaveOccurred ())
@@ -1185,7 +1187,7 @@ var _ = Describe("controller", func() {
1185
1187
cacheSyncDone : sourceSynced ,
1186
1188
},
1187
1189
}
1188
- ctrl .Name = "testcontroller"
1190
+ ctrl .Name = testControllerName
1189
1191
1190
1192
ctx , cancel := context .WithCancel (context .TODO ())
1191
1193
go func () {
0 commit comments