k8s: pre-populate metadata cache. fixes https://github.com/tilt-dev/tilt/issues/3845#3854
Conversation
5b602c7 to
9f842e2
Compare
|
if the PR looks kind of intimidating, it's only really ~100 lines of code and 1,000 lines of tests, most of it very repetitive |
landism
left a comment
There was a problem hiding this comment.
yay batches
do you think it's also worth getting rid of the last uses of K8sClient.dynamic and replacing it with K8sClient.meta, or has this PR taken care of all the throttling issues?
| } | ||
|
|
||
| // As an optimization, we batch fetch all the ObjectMetas of a resource type | ||
| // on startup. |
There was a problem hiding this comment.
Maybe nitty, but this isn't at startup, is it? IIUC, it's the first time we check the objectmeta of any instance of a type, which I think is, like, the first time event watcher or pod watcher get updates? In either case, this part of the code is sufficiently removed from whether it happens at startup that the comment is hard to verify / keep up to date.
There was a problem hiding this comment.
good point! I reworded this
|
re: dynamic - i think we still need it for cases when we need the full resource data (pods, events, etc) |
Hello @landism,
Please review the following commits I made in branch nicks/ch9742:
4a1579a (2020-10-12 20:01:29 -0400)
k8s: pre-populate metadata cache. fixes #3845
Code review reminders, by giving a LGTM you attest that: