feat: add Tag field to IngressRule#1116
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kahirokunn 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1116 +/- ##
=======================================
Coverage 93.33% 93.33%
=======================================
Files 35 35
Lines 1005 1005
=======================================
Hits 938 938
Misses 53 53
Partials 14 14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9d20aea to
045dd9a
Compare
045dd9a to
2e37714
Compare
Allow downstream ingress controllers to propagate traffic tag metadata (e.g. as labels on HTTPRoute/HTTPProxy), improving observability and enabling tag-based extension controllers. Signed-off-by: kahirokunn <okinakahiro@gmail.com>
2e37714 to
e6f4518
Compare
|
/lgtm |
|
Thanks for the review! I did run Happy to wait for @dprotaso's review on the overall direction. The corresponding serving PR is knative/serving#16437 for reference. |
|
Talking in slack - I'm wondering if it's simpler to have a separate An additional benefit of this split is that the ingress resource should remain 'stable' (unchanged) as we make other route updates. /hold |
|
We will handle this through another method, so we are closing this ticket. |
Allow downstream ingress controllers to propagate traffic tag metadata (e.g. as labels on HTTPRoute/HTTPProxy), improving observability and enabling tag-based extension controllers.
Changes
When a Knative Service has traffic tags, tagged HTTPRoutes are generated but have no metadata indicating which tag they belong to. This makes it difficult for external tools to identify the traffic tag from HTTPRoute resources.
The root cause is that
IngressRule— the intermediate representation betweenknative/servingand ingress controllers — does not carry the tag name. The tag is only encoded in the hostname, forcing downstream controllers to reverse-parse it with fragile template-based heuristics (e.g.TagOfHost()in net-gateway-api).This PR adds a
Tag stringfield toIngressRuleso that the tag name is explicitly available to ingress controllers. The field isomitemptyand+optional, making it fully backward compatible.Tagfield toIngressRulestructContext
In knative-extensions/net-gateway-api#931, we attempted to add a tag label to HTTPRoute by reverse-parsing the hostname using the tag template. However, since the tag template format is highly configurable, this approach turned out to be fragile. We concluded that the upstream
IngressRuleshould carry the tag name explicitly rather than relying on hostname heuristics./kind api-change
Release Note
Docs