Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,16 @@ xdsIR:
accessLog:
json:
- path: /dev/stdout
globalResources:
proxyServiceCluster:
name: test-ns/gateway-3
settings:
- metadata:
name: gateway-3
namespace: test-ns
sectionName: "8080"
name: test-ns/gateway-3
protocol: TCP
http:
- address: 0.0.0.0
externalPort: 80
Expand Down
11 changes: 9 additions & 2 deletions internal/gatewayapi/translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,15 @@ func TestTranslate(t *testing.T) {
} else {
for _, g := range resources.Gateways {
gSvc := svc
// Matches proxy.ExpectedResourceHashedName()
gSvc.Name = fmt.Sprintf("%s-%s", config.EnvoyPrefix, utils.GetHashedName(fmt.Sprintf("%s/%s", g.Namespace, g.Name), 48))
if gatewayNamespaceMode {
// In gateway namespace mode, the service name is the same as the gateway name
// and the namespace is the gateway namespace.
gSvc.Name = g.Name
gSvc.Namespace = g.Namespace
} else {
gSvc.Name = fmt.Sprintf("%s-%s", config.EnvoyPrefix, utils.GetHashedName(fmt.Sprintf("%s/%s", g.Namespace, g.Name), 48))
}

gSvc.Labels[OwningGatewayNameLabel] = g.Name
gSvc.Labels[OwningGatewayNamespaceLabel] = g.Namespace
gEndPtSlice := endPtSlice
Expand Down