Skip to content

Commit 19829a9

Browse files
committed
fix: r
Signed-off-by: Ashing Zheng <[email protected]>
1 parent fc816e2 commit 19829a9

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

api/adc/types.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,18 +823,16 @@ var (
823823
// the upstream name.
824824
// the resolveGranularity is not composited in the upstream name when it is endpoint.
825825
// ref: https://github.com/apache/apisix-ingress-controller/blob/10059afe3e84b693cc61e6df7a0040890a9d16eb/pkg/types/apisix/v1/types.go#L595-L598
826-
func ComposeUpstreamName(namespace, name, serviceName, ruleIndex, backendIndex string) string {
826+
func ComposeUpstreamName(namespace, name, ruleIndex, backendIndex string) string {
827827
var p []byte
828-
plen := len(namespace) + len(name) + len(serviceName) + len(ruleIndex) + len(backendIndex) + 4
828+
plen := len(namespace) + len(name) + len(ruleIndex) + len(backendIndex) + 3
829829

830830
p = make([]byte, 0, plen)
831831
buf := bytes.NewBuffer(p)
832832
buf.WriteString(namespace)
833833
buf.WriteByte('_')
834834
buf.WriteString(name)
835835
buf.WriteByte('_')
836-
buf.WriteString(serviceName)
837-
buf.WriteByte('_')
838836
buf.WriteString(ruleIndex)
839837
buf.WriteByte('_')
840838
buf.WriteString(backendIndex)

internal/adc/translator/apisixroute.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func (t *Translator) buildUpstream(tctx *provider.TranslateContext, service *adc
236236
upstream.Labels["meta_weight"] = strconv.FormatInt(int64(*backend.Weight), 10)
237237
}
238238

239-
upstreamName := adc.ComposeUpstreamName(ar.Namespace, ar.Name, backend.ServiceName, fmt.Sprintf("%d", ruleIndex), fmt.Sprintf("%d", backendIndex))
239+
upstreamName := adc.ComposeUpstreamName(ar.Namespace, ar.Name, fmt.Sprintf("%d", ruleIndex), fmt.Sprintf("%d", backendIndex))
240240
upstream.Name = upstreamName
241241
upstream.ID = id.GenID(upstreamName)
242242
upstreams = append(upstreams, upstream)

0 commit comments

Comments
 (0)