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