Enable propagration of HasSynced

* Add tracker types and tests
* Modify ResourceEventHandler interface's OnAdd member
* Add additional ResourceEventHandlerDetailedFuncs struct
* Fix SharedInformer to let users track HasSynced for their handlers
* Fix in-tree controllers which weren't computing HasSynced correctly
* Deprecate the cache.Pop function
This commit is contained in:
Daniel Smith
2022-11-18 00:12:50 +00:00
parent 4b27077eb2
commit 8100efc7b3
23 changed files with 653 additions and 175 deletions

View File

@@ -125,13 +125,13 @@ type conversionEventHandler struct {
handler cache.ResourceEventHandler
}
func (h conversionEventHandler) OnAdd(obj interface{}) {
func (h conversionEventHandler) OnAdd(obj interface{}, isInInitialList bool) {
rs, err := convertRCtoRS(obj.(*v1.ReplicationController), nil)
if err != nil {
utilruntime.HandleError(fmt.Errorf("dropping RC OnAdd event: can't convert object %#v to RS: %v", obj, err))
return
}
h.handler.OnAdd(rs)
h.handler.OnAdd(rs, isInInitialList)
}
func (h conversionEventHandler) OnUpdate(oldObj, newObj interface{}) {