Add opt-in VirtualService informer label filtering#1504
Conversation
|
Welcome @anencore94! It looks like this is your first PR to knative-extensions/net-istio 🎉 |
|
Hi @anencore94. Thanks for your PR. I'm waiting for a knative-extensions member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: anencore94 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
linkvt
left a comment
There was a problem hiding this comment.
Hi @anencore94 ,
thanks for your PR, it looks really good to me but I'm also not a maintainer of the net-istio project so I can't give you an approval or so as I don't have enough background infos on the project.
I left a few comment, I think the use of networking.IngressLabelKey is the most important one as it works I guess but not sure if there is another recommended label to use.
/ok-to-test.
| ObjectMeta: metav1.ObjectMeta{ | ||
| Name: name, | ||
| Namespace: sks.Namespace, | ||
| Labels: map[string]string{networking.IngressLabelKey: sks.Name}, |
There was a problem hiding this comment.
Using this label looks good at first but are there other net- implementations that also use this label? Or do they use different labels?
There was a problem hiding this comment.
Sure, there could be a better label or we could make another. I need another comments from other contributors :)
There was a problem hiding this comment.
Good question. I kept networking.IngressLabelKey intentionally for consistency with existing net-istio ownership/lookup paths: ingress-created VS already use this label, and ingress cleanup/list paths already rely on it (e.g. selectors in ingress reconciler). Using the same key for SKS VS lets informer-level filtering include both ingress-owned and SKS-owned VS without introducing a second ownership label dimension.
|
/ok-to-test |
|
/lgtm What do you think @dprotaso , any opinion on this? Seems quite straight forward. |
|
/hold see: #1503 (comment) I think if the istio client has trouble listing then there's something amiss as that shouldn't happen. |
| if apierrs.IsNotFound(err) { | ||
| vs, err = vsAccessor.GetIstioClient().NetworkingV1beta1().VirtualServices(ns).Create(ctx, desired, metav1.CreateOptions{}) | ||
| if err != nil { | ||
| if apierrs.IsAlreadyExists(err) { |
There was a problem hiding this comment.
Can we drop the changes in this file and it's test directory?
If an error occurs the reconciliation will just happen again - I don't think we should 'recover' here by 'fetching' from the API server.
Or at a minimum pull these changes into a separate PR so we can discuss them separately
| } | ||
|
|
||
| func getVirtualServiceInformer(ctx context.Context) istioinformer.VirtualServiceInformer { | ||
| if informerfiltering.ShouldFilterVSByLabel() { |
There was a problem hiding this comment.
out of curiosity - why is this guarded and getSecretInformer is not?
|
I'm good with a labelling/filtering change like this (excluding the original intent - cause that's a separate issue lol) |
|
Added some review comments |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1504 +/- ##
==========================================
- Coverage 81.96% 81.95% -0.01%
==========================================
Files 23 23
Lines 1519 1546 +27
==========================================
+ Hits 1245 1267 +22
- Misses 180 183 +3
- Partials 94 96 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
networking.knative.dev/ingresslabelUpgrade Notes
GetonAlreadyExists, updates labels, and brings them into the filtered cache on subsequent resyncsTesting