-
Hello, i want to build a custom reflector for different kinds of resources (secrets, configmaps maybe others), Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Answered by
clux
Jul 21, 2023
Replies: 1 comment 3 replies
-
There are some examples of how to plug different resources into reflectors in the example folder, see in particular: |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah, apologies. The Kubernetes api can only return one type at a time, and the
reflector
is made to ensure data availability in the store for a that single ongoing list/watch call (even if the connection is temporarily lost), so it is typed to that item because of this.We haven't seen a need to allow putting more things in one
Store
because you can put multiple reflectors in a struct:and implement a lookup on this struct that directs to the correct store based on a dynamic type / object reference. you would still have to pull on all the associated watch streams, but you can simplify that by flattening…