From 2d4911139c54f11af3b14fff641449f37ddc381a Mon Sep 17 00:00:00 2001 From: zirain Date: Wed, 13 Aug 2025 13:28:17 +0800 Subject: [PATCH 1/2] IR: add DestinationAddressType UDS Signed-off-by: zirain --- internal/gatewayapi/route.go | 2 +- internal/gatewayapi/testdata/accesslog-als-backend.out.yaml | 2 +- .../gatewayapi/testdata/envoyproxy-tracing-backend-uds.out.yaml | 2 +- .../testdata/securitypolicy-with-extauth-backend.out.yaml | 2 +- internal/ir/xds.go | 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index 35b114b980..031764753a 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -2003,7 +2003,7 @@ func (t *Translator) processBackendDestinationSetting( addrTypeMap[ir.FQDN]++ irde = ir.NewDestEndpoint(bep.Hostname, bep.FQDN.Hostname, uint32(bep.FQDN.Port), false, bep.Zone) case bep.Unix != nil: - addrTypeMap[ir.IP]++ + addrTypeMap[ir.UDS]++ irde = &ir.DestinationEndpoint{ Path: ptr.To(bep.Unix.Path), Zone: bep.Zone, diff --git a/internal/gatewayapi/testdata/accesslog-als-backend.out.yaml b/internal/gatewayapi/testdata/accesslog-als-backend.out.yaml index 0ecd9d6029..36d3e30cda 100644 --- a/internal/gatewayapi/testdata/accesslog-als-backend.out.yaml +++ b/internal/gatewayapi/testdata/accesslog-als-backend.out.yaml @@ -163,7 +163,7 @@ xdsIR: namespace: envoy-gateway-system name: accesslog_otel_0_0 settings: - - addressType: IP + - addressType: UDS endpoints: - host: "" path: /var/run/backend.sock diff --git a/internal/gatewayapi/testdata/envoyproxy-tracing-backend-uds.out.yaml b/internal/gatewayapi/testdata/envoyproxy-tracing-backend-uds.out.yaml index ab36d85fcf..81cef801a6 100644 --- a/internal/gatewayapi/testdata/envoyproxy-tracing-backend-uds.out.yaml +++ b/internal/gatewayapi/testdata/envoyproxy-tracing-backend-uds.out.yaml @@ -223,7 +223,7 @@ xdsIR: namespace: envoy-gateway-system name: tracing settings: - - addressType: IP + - addressType: UDS endpoints: - host: "" path: /var/run/envoy-uds/dsd.socket diff --git a/internal/gatewayapi/testdata/securitypolicy-with-extauth-backend.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-extauth-backend.out.yaml index 46ef87404e..e1294c2595 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-extauth-backend.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-extauth-backend.out.yaml @@ -619,7 +619,7 @@ xdsIR: namespace: default name: securitypolicy/default/policy-for-http-route-3-http-backendref/extauth/0 settings: - - addressType: IP + - addressType: UDS endpoints: - host: "" path: /var/run/uds.sock diff --git a/internal/ir/xds.go b/internal/ir/xds.go index b7514a535d..cc55f0de90 100644 --- a/internal/ir/xds.go +++ b/internal/ir/xds.go @@ -1685,6 +1685,7 @@ const ( IP DestinationAddressType = "IP" FQDN DestinationAddressType = "FQDN" MIXED DestinationAddressType = "Mixed" + UDS DestinationAddressType = "UDS" ) // DestinationEndpoint holds the endpoint details associated with the destination From 7188a23888caf2f7a3aae482b1ccd6beec5daa34 Mon Sep 17 00:00:00 2001 From: zirain Date: Wed, 13 Aug 2025 13:33:19 +0800 Subject: [PATCH 2/2] xds translator Signed-off-by: zirain --- .../xds/translator/testdata/in/xds-ir/tracing-datadog-uds.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/xds/translator/testdata/in/xds-ir/tracing-datadog-uds.yaml b/internal/xds/translator/testdata/in/xds-ir/tracing-datadog-uds.yaml index 694c99fd27..5281717c86 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tracing-datadog-uds.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tracing-datadog-uds.yaml @@ -21,7 +21,7 @@ tracing: destination: name: "tracing-0" settings: - - addressType: IP + - addressType: UDS endpoints: - host: "" path: /var/run/envoy-uds/dsd.socket