@@ -84,7 +84,7 @@ func newCluster(t testing.TB, objs ...runtime.Object) *clusterCache {
84
84
return cache
85
85
}
86
86
87
- func newClusterWithOptions (t testing.TB , opts []UpdateSettingsFunc , objs ... runtime.Object ) * clusterCache {
87
+ func newClusterWithOptions (_ testing.TB , opts []UpdateSettingsFunc , objs ... runtime.Object ) * clusterCache {
88
88
client := fake .NewSimpleDynamicClient (scheme .Scheme , objs ... )
89
89
reactor := client .ReactionChain [0 ]
90
90
client .PrependReactor ("list" , "*" , func (action testcore.Action ) (handled bool , ret runtime.Object , err error ) {
@@ -175,7 +175,7 @@ func Benchmark_sync(t *testing.B) {
175
175
176
176
c := newCluster (t , resources ... )
177
177
178
- c .populateResourceInfoHandler = func (un * unstructured.Unstructured , isRoot bool ) (info any , cacheManifest bool ) {
178
+ c .populateResourceInfoHandler = func (_ * unstructured.Unstructured , _ bool ) (info any , cacheManifest bool ) {
179
179
time .Sleep (10 * time .Microsecond )
180
180
return nil , false
181
181
}
@@ -394,7 +394,7 @@ func TestGetChildren(t *testing.T) {
394
394
395
395
func TestGetManagedLiveObjs (t * testing.T ) {
396
396
cluster := newCluster (t , testPod1 (), testRS (), testDeploy ())
397
- cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot bool ) (info any , cacheManifest bool ) {
397
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (_ * unstructured.Unstructured , _ bool ) (info any , cacheManifest bool ) {
398
398
return nil , true
399
399
}))
400
400
@@ -420,7 +420,7 @@ metadata:
420
420
421
421
func TestGetManagedLiveObjsNamespacedModeClusterLevelResource (t * testing.T ) {
422
422
cluster := newCluster (t , testPod1 (), testRS (), testDeploy ())
423
- cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot bool ) (info any , cacheManifest bool ) {
423
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (_ * unstructured.Unstructured , _ bool ) (info any , cacheManifest bool ) {
424
424
return nil , true
425
425
}))
426
426
cluster .namespaces = []string {"default" , "production" }
@@ -445,7 +445,7 @@ metadata:
445
445
446
446
func TestGetManagedLiveObjsNamespacedModeClusterLevelResource_ClusterResourceEnabled (t * testing.T ) {
447
447
cluster := newCluster (t , testPod1 (), testRS (), testDeploy ())
448
- cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot bool ) (info any , cacheManifest bool ) {
448
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (_ * unstructured.Unstructured , _ bool ) (info any , cacheManifest bool ) {
449
449
return nil , true
450
450
}))
451
451
cluster .namespaces = []string {"default" , "production" }
@@ -486,7 +486,7 @@ metadata:
486
486
487
487
func TestGetManagedLiveObjsAllNamespaces (t * testing.T ) {
488
488
cluster := newCluster (t , testPod1 (), testRS (), testDeploy ())
489
- cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot bool ) (info any , cacheManifest bool ) {
489
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (_ * unstructured.Unstructured , _ bool ) (info any , cacheManifest bool ) {
490
490
return nil , true
491
491
}))
492
492
cluster .namespaces = nil
@@ -514,7 +514,7 @@ metadata:
514
514
515
515
func TestGetManagedLiveObjsValidNamespace (t * testing.T ) {
516
516
cluster := newCluster (t , testPod1 (), testRS (), testDeploy ())
517
- cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot bool ) (info any , cacheManifest bool ) {
517
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (_ * unstructured.Unstructured , _ bool ) (info any , cacheManifest bool ) {
518
518
return nil , true
519
519
}))
520
520
cluster .namespaces = []string {"default" , "production" }
@@ -542,7 +542,7 @@ metadata:
542
542
543
543
func TestGetManagedLiveObjsInvalidNamespace (t * testing.T ) {
544
544
cluster := newCluster (t , testPod1 (), testRS (), testDeploy ())
545
- cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot bool ) (info any , cacheManifest bool ) {
545
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (_ * unstructured.Unstructured , _ bool ) (info any , cacheManifest bool ) {
546
546
return nil , true
547
547
}))
548
548
cluster .namespaces = []string {"default" , "develop" }
@@ -602,7 +602,7 @@ func TestGetManagedLiveObjsFailedConversion(t *testing.T) {
602
602
Meta : metav1.APIResource {Namespaced : true },
603
603
},
604
604
})
605
- cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot bool ) (info any , cacheManifest bool ) {
605
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (_ * unstructured.Unstructured , _ bool ) (info any , cacheManifest bool ) {
606
606
return nil , true
607
607
}))
608
608
cluster .namespaces = []string {"default" }
@@ -634,7 +634,7 @@ metadata:
634
634
return testCronTab (), nil
635
635
})
636
636
637
- managedObjs , err := cluster .GetManagedLiveObjs ([]* unstructured.Unstructured {targetDeploy }, func (r * Resource ) bool {
637
+ managedObjs , err := cluster .GetManagedLiveObjs ([]* unstructured.Unstructured {targetDeploy }, func (_ * Resource ) bool {
638
638
return true
639
639
})
640
640
assert .NoError (t , err )
@@ -1258,7 +1258,7 @@ func Test_watchEvents_Deadlock(t *testing.T) {
1258
1258
// Resync watches often to use the semaphore and trigger the rate limiting behavior
1259
1259
SetResyncTimeout (500 * time .Millisecond ),
1260
1260
// Use new resource handler to run code in the list callbacks
1261
- SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot bool ) (info any , cacheManifest bool ) {
1261
+ SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , _ bool ) (info any , cacheManifest bool ) {
1262
1262
if un .GroupVersionKind ().GroupKind () == res1 .GroupVersionKind ().GroupKind () ||
1263
1263
un .GroupVersionKind ().GroupKind () == res2 .GroupVersionKind ().GroupKind () {
1264
1264
// Create a bottleneck for resources holding the semaphore
@@ -1370,7 +1370,7 @@ func BenchmarkIterateHierarchyV2(b *testing.B) {
1370
1370
for n := 0 ; n < b .N ; n ++ {
1371
1371
cluster .IterateHierarchyV2 ([]kube.ResourceKey {
1372
1372
{Namespace : "default" , Name : "test-1" , Kind : "Pod" },
1373
- }, func (child * Resource , _ map [kube.ResourceKey ]* Resource ) bool {
1373
+ }, func (_ * Resource , _ map [kube.ResourceKey ]* Resource ) bool {
1374
1374
return true
1375
1375
})
1376
1376
}
0 commit comments