@@ -35,7 +35,7 @@ import (
35
35
"github.com/argoproj/gitops-engine/pkg/utils/kube/kubetest"
36
36
)
37
37
38
- func mustToUnstructured (obj interface {} ) * unstructured.Unstructured {
38
+ func mustToUnstructured (obj any ) * unstructured.Unstructured {
39
39
un , err := kube .ToUnstructured (obj )
40
40
if err != nil {
41
41
panic (err )
@@ -44,7 +44,7 @@ func mustToUnstructured(obj interface{}) *unstructured.Unstructured {
44
44
}
45
45
46
46
func strToUnstructured (jsonStr string ) * unstructured.Unstructured {
47
- obj := make (map [string ]interface {} )
47
+ obj := make (map [string ]any )
48
48
err := yaml .Unmarshal ([]byte (jsonStr ), & obj )
49
49
if err != nil {
50
50
panic (err )
@@ -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 interface {} , cacheManifest bool ) {
178
+ c .populateResourceInfoHandler = func (un * unstructured.Unstructured , isRoot 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 interface {} , cacheManifest bool ) {
397
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot 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 interface {} , cacheManifest bool ) {
423
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot 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 interface {} , cacheManifest bool ) {
448
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot 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 interface {} , cacheManifest bool ) {
489
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot 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 interface {} , cacheManifest bool ) {
517
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot 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 interface {} , cacheManifest bool ) {
545
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot 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 interface {} , cacheManifest bool ) {
605
+ cluster .Invalidate (SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot bool ) (info any , cacheManifest bool ) {
606
606
return nil , true
607
607
}))
608
608
cluster .namespaces = []string {"default" }
@@ -953,14 +953,14 @@ func testCRD() *apiextensions.CustomResourceDefinition {
953
953
}
954
954
955
955
func testCronTab () * unstructured.Unstructured {
956
- return & unstructured.Unstructured {Object : map [string ]interface {} {
956
+ return & unstructured.Unstructured {Object : map [string ]any {
957
957
"apiVersion" : "stable.example.com/v1" ,
958
958
"kind" : "CronTab" ,
959
- "metadata" : map [string ]interface {} {
959
+ "metadata" : map [string ]any {
960
960
"name" : "test-crontab" ,
961
961
"namespace" : "default" ,
962
962
},
963
- "spec" : map [string ]interface {} {
963
+ "spec" : map [string ]any {
964
964
"cronSpec" : "* * * * */5" ,
965
965
"image" : "my-awesome-cron-image" ,
966
966
},
@@ -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 interface {} , cacheManifest bool ) {
1261
+ SetPopulateResourceInfoHandler (func (un * unstructured.Unstructured , isRoot 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
0 commit comments