-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal/dag: Fix comparison of include match conditions #4931
internal/dag: Fix comparison of include match conditions #4931
Conversation
Previously includeMatchConditionsIdentical was just comparing adjacent includes and comparing conditions element by element rather than as a whole, ANDed together Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
might do another pass on the implementation to see if we can do something more elegant currently uses the existing conversions to dag types for match conditions that are then sorted and stringified so they can be compared since this happens before the match conditions are deemed valid or not, this is a little odd maybe |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4931 +/- ##
=======================================
Coverage 77.63% 77.63%
=======================================
Files 140 140
Lines 16894 16922 +28
=======================================
+ Hits 13116 13138 +22
- Misses 3521 3526 +5
- Partials 257 258 +1
|
The Contour project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to the #contour channel in the Kubernetes Slack |
…d-comparison Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Also moves the check after checking for validity of the include condition, to make sure we're not trying to check semantically invalid conditions. The included proxies that come before we find a duplicate are now not marked as orphaned, which is a small behavior change. Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
…d-comparison Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
from 37edb30
maybe not desirable, would be good to hear what people thing about this |
If I'm reading it correctly, if we do end up finding a duplicate set of conditions on any two included proxies, then we end up not programming routes for any of the includes on the root HTTPProxy. Is that right? In that case, it does seem to me like all of those included proxies that didn't end up getting programmed should probably be called orphaned. |
Possibly an easy fix would be on contour/internal/dag/httpproxy_processor.go Line 675 in dc0d593
p.orphaned , just keep track of a list of child proxies that we want to eventually remove from p.orphaned , then if we get to contour/internal/dag/httpproxy_processor.go Line 677 in dc0d593 p.orphaned there
|
ah good point, I was kinda thinking of the orphaned relationship similar to the Gateway/Route |
Yeah I think in this case it's probably safest to stick to the existing semantics, where child proxies that have an invalid include of them are called orphaned, rather than some form of attached + invalid. |
to preserve traffic as much as possible more similar to how other types of invalid match conditions are processed Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
we can preserve some more of the includes/routes etc. that are valid by not returning early which would mean some traffic is still able to be served: 3ff0eaa
this commit makes it so the valid stuff is still programmed (missed that I had it |
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
…d-comparison Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the updates, LGTM!
…our#4931) Previously includeMatchConditionsIdentical was just comparing adjacent includes and comparing conditions element by element rather than as a whole, ANDed together Also don't exit processor early so other routes etc. are configured to preserve traffic as much as possible. This behavior is more similar to how other types of invalid match conditions are processed Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com> Signed-off-by: yy <yang.yang@daocloud.io>
…our#4931) Previously includeMatchConditionsIdentical was just comparing adjacent includes and comparing conditions element by element rather than as a whole, ANDed together Also don't exit processor early so other routes etc. are configured to preserve traffic as much as possible. This behavior is more similar to how other types of invalid match conditions are processed Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com> Signed-off-by: yy <yang.yang@daocloud.io>
…our#4931) Previously includeMatchConditionsIdentical was just comparing adjacent includes and comparing conditions element by element rather than as a whole, ANDed together Also don't exit processor early so other routes etc. are configured to preserve traffic as much as possible. This behavior is more similar to how other types of invalid match conditions are processed Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Previously includeMatchConditionsIdentical was just comparing adjacent includes and comparing conditions element by element rather than as a whole, ANDed together
Fixes #4907