Code changes to support Kube 0.26 deps

This commit is contained in:
Ryan Richard
2023-01-18 14:39:22 -08:00
parent a430f4b730
commit 7ff3b3d9cb
13 changed files with 139 additions and 83 deletions
+6 -2
View File
@@ -1,4 +1,4 @@
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
// Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package controllerlib
@@ -59,7 +59,7 @@ func WithInformer(getter InformerGetter, filter Filter, opt InformerOption) Opti
return
}
informer.AddEventHandler(cache.ResourceEventHandlerFuncs{
_, err := informer.AddEventHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
object := metaOrDie(obj)
if filter.Add(object) {
@@ -113,6 +113,10 @@ func WithInformer(getter InformerGetter, filter Filter, opt InformerOption) Opti
}
},
})
if err != nil {
// Shouldn't really happen.
panic(die(fmt.Sprintf("got error from AddEventHandler: %s", err.Error())))
}
})
}