feat: set IngressRule.Tag from traffic target name#16437
feat: set IngressRule.Tag from traffic target name#16437kahirokunn wants to merge 1 commit intoknative:mainfrom
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 #16437 +/- ##
==========================================
+ Coverage 80.16% 80.22% +0.05%
==========================================
Files 217 217
Lines 13503 13521 +18
==========================================
+ Hits 10825 10847 +22
+ Misses 2310 2309 -1
+ Partials 368 365 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Populate the new Tag field when building IngressRules so that downstream ingress controllers can trace generated resources back to their originating traffic tag. Signed-off-by: kahirokunn <okinakahiro@gmail.com>
3948883 to
4878572
Compare
|
@kahirokunn: The following tests 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. |
|
/hold |
|
Following discussions on Slack, we will adopt this option. |
Populate the new Tag field when building IngressRules so that downstream ingress controllers can trace generated resources back to their originating traffic tag.
Proposed 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
IngressRuledoes not carry the tag name — it is only encoded in the hostname, forcing downstream controllers to reverse-parse it with fragile template-based heuristics.This PR populates the new
IngressRule.Tagfield (added in knative/networking) with the traffic target name during route reconciliation, so that downstream ingress controllers can propagate the tag as labels on generated resources (e.g. HTTPRoute, HTTPProxy).tag stringparameter tomakeIngressRules()andmakeIngressRuleForHosts()IngressRule.Tagfrom the traffic target name inmakeIngressSpec()Tagfield onIngressRuleRelated PRs
Tagfield toIngressRule)Context
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.Release Note