@@ -192,15 +192,20 @@ func (t *translator) TranslateGatewayHTTPRouteV1beta1(httpRoute *gatewayv1beta1.
192
192
if err != nil {
193
193
return nil , errors .Wrap (err , fmt .Sprintf ("failed to translate Rules[%v].BackendRefs[%v]" , i , j ))
194
194
}
195
- name : = apisixv1 .ComposeUpstreamName (ns , string (backend .Name ), "" , int32 (* backend .Port ), types .ResolveGranularity .Endpoint )
195
+ ups . Name = apisixv1 .ComposeUpstreamName (ns , string (backend .Name ), "" , int32 (* backend .Port ), types .ResolveGranularity .Endpoint )
196
196
197
197
// APISIX limits max length of label value
198
198
// https://github.com/apache/apisix/blob/5b95b85faea3094d5e466ee2d39a52f1f805abbb/apisix/schema_def.lua#L85
199
199
ups .Labels ["meta_namespace" ] = utils .TruncateString (ns , 64 )
200
200
ups .Labels ["meta_backend" ] = utils .TruncateString (string (backend .Name ), 64 )
201
201
ups .Labels ["meta_port" ] = fmt .Sprintf ("%v" , int32 (* backend .Port ))
202
202
203
- ups .ID = id .GenID (name )
203
+ ups .ID = id .GenID (ups .Name )
204
+ log .Debugw ("translated HTTPRoute upstream" ,
205
+ zap .Int ("backendRefs_index" , j ),
206
+ zap .String ("backendRefs_name" , string (backend .Name )),
207
+ zap .String ("name" , ups .Name ),
208
+ )
204
209
ctx .AddUpstream (ups )
205
210
ruleUpstreams = append (ruleUpstreams , ups )
206
211
0 commit comments