@@ -216,7 +216,7 @@ var _ = Describe("Cache with transformers", func() {
216216
217217 By ("creating the informer cache" )
218218 informerCache , err = cache .New (cfg , cache.Options {
219- DefaultTransform : func (i interface {} ) (interface {} , error ) {
219+ DefaultTransform : func (i any ) (any , error ) {
220220 obj := i .(runtime.Object )
221221 Expect (obj ).NotTo (BeNil ())
222222
@@ -238,7 +238,7 @@ var _ = Describe("Cache with transformers", func() {
238238 },
239239 ByObject : map [client.Object ]cache.ByObject {
240240 & corev1.Pod {}: {
241- Transform : func (i interface {} ) (interface {} , error ) {
241+ Transform : func (i any ) (any , error ) {
242242 obj := i .(runtime.Object )
243243 Expect (obj ).NotTo (BeNil ())
244244 accessor , err := meta .Accessor (obj )
@@ -1103,7 +1103,7 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
11031103 Expect (out ).To (Equal (uKnownPod2 ))
11041104
11051105 By ("altering a field in the retrieved pod" )
1106- m , _ := out .Object ["spec" ].(map [string ]interface {} )
1106+ m , _ := out .Object ["spec" ].(map [string ]any )
11071107 m ["activeDeadlineSeconds" ] = 4
11081108
11091109 By ("verifying the pods are no longer equal" )
@@ -1954,8 +1954,8 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
19541954 Expect (sii .HasSynced ()).To (BeTrue ())
19551955
19561956 By ("adding an event handler listening for object creation which sends the object to a channel" )
1957- out := make (chan interface {} )
1958- addFunc := func (obj interface {} ) {
1957+ out := make (chan any )
1958+ addFunc := func (obj any ) {
19591959 out <- obj
19601960 }
19611961 _ , _ = sii .AddEventHandler (kcache.ResourceEventHandlerFuncs {AddFunc : addFunc })
@@ -2014,8 +2014,8 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
20142014 Expect (sii .HasSynced ()).To (BeTrue ())
20152015
20162016 By ("adding an event handler listening for object creation which sends the object to a channel" )
2017- out := make (chan interface {} )
2018- addFunc := func (obj interface {} ) {
2017+ out := make (chan any )
2018+ addFunc := func (obj any ) {
20192019 out <- obj
20202020 }
20212021 _ , _ = sii .AddEventHandler (kcache.ResourceEventHandlerFuncs {AddFunc : addFunc })
@@ -2196,9 +2196,9 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
21962196 By ("getting a shared index informer for a pod" )
21972197
21982198 pod := & unstructured.Unstructured {
2199- Object : map [string ]interface {} {
2200- "spec" : map [string ]interface {} {
2201- "containers" : []map [string ]interface {} {
2199+ Object : map [string ]any {
2200+ "spec" : map [string ]any {
2201+ "containers" : []map [string ]any {
22022202 {
22032203 "name" : "nginx" ,
22042204 "image" : "nginx" ,
@@ -2220,8 +2220,8 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
22202220 Expect (sii .HasSynced ()).To (BeTrue ())
22212221
22222222 By ("adding an event handler listening for object creation which sends the object to a channel" )
2223- out := make (chan interface {} )
2224- addFunc := func (obj interface {} ) {
2223+ out := make (chan any )
2224+ addFunc := func (obj any ) {
22252225 out <- obj
22262226 }
22272227 _ , _ = sii .AddEventHandler (kcache.ResourceEventHandlerFuncs {AddFunc : addFunc })
@@ -2239,9 +2239,9 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
22392239 It ("should be able to stop and restart informers" , func (ctx SpecContext ) {
22402240 By ("getting a shared index informer for a pod" )
22412241 pod := & unstructured.Unstructured {
2242- Object : map [string ]interface {} {
2243- "spec" : map [string ]interface {} {
2244- "containers" : []map [string ]interface {} {
2242+ Object : map [string ]any {
2243+ "spec" : map [string ]any {
2244+ "containers" : []map [string ]any {
22452245 {
22462246 "name" : "nginx" ,
22472247 "image" : "nginx" ,
@@ -2294,7 +2294,7 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
22942294 if ! ok {
22952295 return []string {}
22962296 }
2297- m , ok := s .(map [string ]interface {} )
2297+ m , ok := s .(map [string ]any )
22982298 if ! ok {
22992299 return []string {}
23002300 }
@@ -2379,8 +2379,8 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
23792379 Expect (sii .HasSynced ()).To (BeTrue ())
23802380
23812381 By ("adding an event handler listening for object creation which sends the object to a channel" )
2382- out := make (chan interface {} )
2383- addFunc := func (obj interface {} ) {
2382+ out := make (chan any )
2383+ addFunc := func (obj any ) {
23842384 out <- obj
23852385 }
23862386 _ , _ = sii .AddEventHandler (kcache.ResourceEventHandlerFuncs {AddFunc : addFunc })
0 commit comments