@@ -28,6 +28,8 @@ import (
28
28
"testing"
29
29
"time"
30
30
31
+ "github.com/phayes/freeport"
32
+ "github.com/sirupsen/logrus"
31
33
"golang.org/x/crypto/bcrypt"
32
34
"helm.sh/helm/v3/pkg/getter"
33
35
helmreg "helm.sh/helm/v3/pkg/registry"
@@ -36,18 +38,16 @@ import (
36
38
"k8s.io/client-go/tools/record"
37
39
ctrl "sigs.k8s.io/controller-runtime"
38
40
39
- dcontext "github.com/distribution/distribution/v3/context"
40
- "github.com/fluxcd/pkg/runtime/controller"
41
- "github.com/fluxcd/pkg/runtime/testenv"
42
- "github.com/fluxcd/pkg/testserver"
43
- "github.com/phayes/freeport"
44
- "github.com/sirupsen/logrus"
45
-
46
41
"github.com/distribution/distribution/v3/configuration"
42
+ dcontext "github.com/distribution/distribution/v3/context"
47
43
dockerRegistry "github.com/distribution/distribution/v3/registry"
48
44
_ "github.com/distribution/distribution/v3/registry/auth/htpasswd"
49
45
_ "github.com/distribution/distribution/v3/registry/storage/driver/inmemory"
50
46
47
+ "github.com/fluxcd/pkg/runtime/controller"
48
+ "github.com/fluxcd/pkg/runtime/testenv"
49
+ "github.com/fluxcd/pkg/testserver"
50
+
51
51
sourcev1 "github.com/fluxcd/source-controller/api/v1beta2"
52
52
"github.com/fluxcd/source-controller/internal/cache"
53
53
"github.com/fluxcd/source-controller/internal/features"
@@ -241,7 +241,9 @@ func TestMain(m *testing.M) {
241
241
features : map [string ]bool {
242
242
features .OptimizedGitClones : true ,
243
243
},
244
- }).SetupWithManager (testEnv ); err != nil {
244
+ }).SetupWithManagerAndOptions (testEnv , GitRepositoryReconcilerOptions {
245
+ RateLimiter : controller .GetDefaultRateLimiter (),
246
+ }); err != nil {
245
247
panic (fmt .Sprintf ("Failed to start GitRepositoryReconciler: %v" , err ))
246
248
}
247
249
@@ -250,7 +252,9 @@ func TestMain(m *testing.M) {
250
252
EventRecorder : record .NewFakeRecorder (32 ),
251
253
Metrics : testMetricsH ,
252
254
Storage : testStorage ,
253
- }).SetupWithManager (testEnv ); err != nil {
255
+ }).SetupWithManagerAndOptions (testEnv , BucketReconcilerOptions {
256
+ RateLimiter : controller .GetDefaultRateLimiter (),
257
+ }); err != nil {
254
258
panic (fmt .Sprintf ("Failed to start BucketReconciler: %v" , err ))
255
259
}
256
260
@@ -262,7 +266,9 @@ func TestMain(m *testing.M) {
262
266
EventRecorder : record .NewFakeRecorder (32 ),
263
267
Metrics : testMetricsH ,
264
268
Storage : testStorage ,
265
- }).SetupWithManager (testEnv ); err != nil {
269
+ }).SetupWithManagerAndOptions (testEnv , OCIRepositoryReconcilerOptions {
270
+ RateLimiter : controller .GetDefaultRateLimiter (),
271
+ }); err != nil {
266
272
panic (fmt .Sprintf ("Failed to start OCIRepositoryReconciler: %v" , err ))
267
273
}
268
274
@@ -275,7 +281,9 @@ func TestMain(m *testing.M) {
275
281
Cache : testCache ,
276
282
TTL : 1 * time .Second ,
277
283
CacheRecorder : cacheRecorder ,
278
- }).SetupWithManager (testEnv ); err != nil {
284
+ }).SetupWithManagerAndOptions (testEnv , HelmRepositoryReconcilerOptions {
285
+ RateLimiter : controller .GetDefaultRateLimiter (),
286
+ }); err != nil {
279
287
panic (fmt .Sprintf ("Failed to start HelmRepositoryReconciler: %v" , err ))
280
288
}
281
289
@@ -285,7 +293,9 @@ func TestMain(m *testing.M) {
285
293
Metrics : testMetricsH ,
286
294
Getters : testGetters ,
287
295
RegistryClientGenerator : registry .ClientGenerator ,
288
- }).SetupWithManager (testEnv ); err != nil {
296
+ }).SetupWithManagerAndOptions (testEnv , HelmRepositoryReconcilerOptions {
297
+ RateLimiter : controller .GetDefaultRateLimiter (),
298
+ }); err != nil {
289
299
panic (fmt .Sprintf ("Failed to start HelmRepositoryOCIReconciler: %v" , err ))
290
300
}
291
301
@@ -298,8 +308,10 @@ func TestMain(m *testing.M) {
298
308
Cache : testCache ,
299
309
TTL : 1 * time .Second ,
300
310
CacheRecorder : cacheRecorder ,
301
- }).SetupWithManager (testEnv ); err != nil {
302
- panic (fmt .Sprintf ("Failed to start HelmRepositoryReconciler: %v" , err ))
311
+ }).SetupWithManagerAndOptions (testEnv , HelmChartReconcilerOptions {
312
+ RateLimiter : controller .GetDefaultRateLimiter (),
313
+ }); err != nil {
314
+ panic (fmt .Sprintf ("Failed to start HelmChartReconciler: %v" , err ))
303
315
}
304
316
305
317
go func () {
0 commit comments