Revert "simplify RC and SVC listers"

This commit is contained in:
Antoine Pelisse
2016-09-21 15:49:38 -07:00
committed by GitHub
parent ca00e596bd
commit 938872582e
23 changed files with 326 additions and 315 deletions

View File

@@ -269,16 +269,16 @@ func (rm *ReplicationManager) getPodController(pod *api.Pod) *api.ReplicationCon
}
// update lookup cache
rm.lookupCache.Update(pod, controllers[0])
rm.lookupCache.Update(pod, &controllers[0])
return controllers[0]
return &controllers[0]
}
// isCacheValid check if the cache is valid
func (rm *ReplicationManager) isCacheValid(pod *api.Pod, cachedRC *api.ReplicationController) bool {
_, err := rm.rcStore.ReplicationControllers(cachedRC.Namespace).Get(cachedRC.Name)
exists, err := rm.rcStore.Exists(cachedRC)
// rc has been deleted or updated, cache is invalid
if err != nil || !isControllerMatch(pod, cachedRC) {
if err != nil || !exists || !isControllerMatch(pod, cachedRC) {
return false
}
return true