@@ -63,6 +63,7 @@ async fn get_svc_port_number(
6363
6464async fn create_http_route (
6565 ctx : Arc < ctx:: Context > ,
66+ ingress_name : & str ,
6667 section_name : Option < & String > ,
6768 ingress_namespace : & str ,
6869 http : & k8s_openapi:: api:: networking:: v1:: HTTPIngressRuleValue ,
@@ -139,7 +140,7 @@ async fn create_http_route(
139140 if rules. is_empty ( ) {
140141 return Err ( anyhow:: anyhow!( "No valid paths found" ) . into ( ) ) ;
141142 }
142- let route_name = format ! ( "{safe_hostname}-http" ) ;
143+ let route_name = format ! ( "{ingress_name}-{ safe_hostname}-http" ) ;
143144 Ok ( HTTPRoute :: new (
144145 & route_name,
145146 HTTPRouteSpec {
@@ -163,6 +164,7 @@ async fn create_http_route(
163164
164165async fn create_tcp_route (
165166 ctx : Arc < ctx:: Context > ,
167+ ingress_name : & str ,
166168 section_name : Option < & String > ,
167169 namespace : & str ,
168170 svc : & IngressServiceBackend ,
@@ -193,7 +195,7 @@ async fn create_tcp_route(
193195 ) ;
194196 } ;
195197 Ok ( TCPRoute :: new (
196- & format ! ( "{safe_hostname}-tcp" ) ,
198+ & format ! ( "{ingress_name}-{ safe_hostname}-tcp" ) ,
197199 TCPRouteSpec {
198200 use_default_gateways : None ,
199201 rules : [ TCPRouteRules {
@@ -257,6 +259,7 @@ pub async fn reconcile(ingress: Arc<Ingress>, ctx: Arc<ctx::Context>) -> I2GResu
257259 if let Some ( http) = & rule. http {
258260 let Ok ( mut route) = create_http_route (
259261 ctx. clone ( ) ,
262+ & ingress. name_any ( ) ,
260263 desired_section_name. as_ref ( ) ,
261264 & ingress_namespace,
262265 & http,
@@ -301,6 +304,7 @@ pub async fn reconcile(ingress: Arc<Ingress>, ctx: Arc<ctx::Context>) -> I2GResu
301304
302305 let Ok ( mut route) = create_tcp_route (
303306 ctx. clone ( ) ,
307+ & ingress. name_any ( ) ,
304308 desired_section_name. as_ref ( ) ,
305309 & ingress_namespace,
306310 backend_svc,
0 commit comments