Skip to content

Commit 3031ed0

Browse files
committed
f
1 parent 09800a7 commit 3031ed0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

internal/adc/translator/apisixroute.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ func (t *Translator) buildUpstream(tctx *provider.TranslateContext, service *adc
240240
upstreamName := adc.ComposeUpstreamName(ar.Namespace, ar.Name, fmt.Sprintf("%d", ruleIndex), fmt.Sprintf("%d", backendIndex))
241241
upstream.Name = upstreamName
242242
upstream.ID = id.GenID(upstreamName)
243+
upstream.Scheme = cmp.Or(upstream.Scheme, apiv2.SchemeHTTP)
243244
upstreams = append(upstreams, upstream)
244245
}
245246

@@ -265,6 +266,7 @@ func (t *Translator) buildUpstream(tctx *provider.TranslateContext, service *adc
265266
upstreamName := adc.ComposeExternalUpstreamName(upsNN.Namespace, upsNN.Name)
266267
upstream.Name = upstreamName
267268
upstream.ID = id.GenID(upstreamName)
269+
upstream.Scheme = cmp.Or(upstream.Scheme, apiv2.SchemeHTTP)
268270
upstreams = append(upstreams, upstream)
269271
}
270272

internal/adc/translator/httproute.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package translator
1919

2020
import (
21+
"cmp"
2122
"encoding/json"
2223
"fmt"
2324
"strings"
@@ -561,6 +562,7 @@ func (t *Translator) TranslateHTTPRoute(tctx *provider.TranslateContext, httpRou
561562
name := string(backend.Name)
562563
upstreamName := adctypes.ComposeUpstreamNameForBackendRef(kind, namespace, name, port)
563564
upstream.Name = upstreamName
565+
upstream.Scheme = cmp.Or(upstream.Scheme, apiv2.SchemeHTTP)
564566
upstream.ID = id.GenID(upstreamName)
565567
upstreams = append(upstreams, upstream)
566568
}

0 commit comments

Comments
 (0)