krt: make krt and kube client indexes named#55999
krt: make krt and kube client indexes named#55999istio-testing merged 5 commits intoistio:masterfrom
Conversation
502cec4 to
69b8342
Compare
69b8342 to
db2cd28
Compare
|
/retest |
| // NewIndex creates a simple index, keyed by key K, over an informer for O. This is similar to | ||
| // NewIndex creates a simple index, keyed by key K, over a collection for O. This is similar to | ||
| // Informer.AddIndex, but is easier to use and can be added after an informer has already started. | ||
| // Different collection implementations may reuse existing indexes with the same name. |
There was a problem hiding this comment.
Might be worth noting: two different informer collections do share the same index. This differs from other collections
There was a problem hiding this comment.
added clarification for this, let me know if it's enough
| pc := clienttest.NewWriter[*corev1.Pod](t, c) | ||
| c.RunAndWait(test.NewStop(t)) | ||
| index := kclient.CreateStringIndex[*corev1.Pod](pods, func(pod *corev1.Pod) []string { | ||
| index := kclient.CreateStringIndex[*corev1.Pod](pods, "podIp", func(pod *corev1.Pod) []string { |
There was a problem hiding this comment.
For these common indexes on informers, we may want to make a common package of 'wellknown' indexes. This way its easy to know when we can share an index and its much harder to accidentally define the same name but different extraction
There was a problem hiding this comment.
It seems like a good idea, but would probably be more useful for krt? There seem to be very few indexes we use on kclient (only 4 indexes outside of tests), this one is actually only used in tests. With extended krt usage we would probably reduce the amount of kclient indexes we create.
|
/retest |
|
@sschepens: The following test failed, say
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
* make krt and kube client indexes named to allow reusing indexes * comment * comment
* make krt and kube client indexes named to allow reusing indexes * comment * comment
* make krt and kube client indexes named to allow reusing indexes * comment * comment
* upstream/master: remove 1.23 compatibility profile (istio#56023) Create ambient multinetwork flag (istio#55991) krt: make krt and kube client indexes named (istio#55999) Automator: update proxy@master in istio/istio@master (istio#56026) fix istio-revision-tag-default MutatingWebhookConfigurations is not created during installation (istio#56004) doc: fix typo in accesslog test (istio#55117) fix(networking): Add absolute FQDNs (trailing dot) to VirtualHost domains (istio#56008)
Please provide a description of this PR:
Made both
krtandkubeclientIndexreceive a requirednameparameter which is used to check uniqueness and allow reusing existing indexes.Currently all
Informerscreates a defaultnamespaceindex, but this is not being reused bykrtin any way, so we're duplicating namespace indexes for all informers thatkrtindexes by namespace.