-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This simplifies the picture, since each cache will have a single event handler, so I don't have to keep track of the event handlers. If I want to stop watching a type in a cluster, I can stop the cache. Caches are what can be started and stopped, so it's best to garbage collect a cache at a time. A cache uses resources -- an HTTP client, goroutines -- so there is a balance between having fine control over how much is watched, and how many caches need taking care of. I could go further and create a cache per {cluster, type, namespace}. This would mean I don't need to watch any namespaces that don't have pipeline targets in them -- so a narrower set of permissions is needed, and the event handler doesn't see as many spurious events. However, it would mean `O(clusters x types x namespaces)` resources. I don't think it would be difficult to adapt the code here to do it, if experience shows it would be better.
- Loading branch information
Showing
1 changed file
with
43 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters