Skip to content

Commit 68f941f

Browse files
committed
fix gen
Signed-off-by: Huabing (Robin) Zhao <[email protected]>
1 parent c96448e commit 68f941f

File tree

5 files changed

+20
-26
lines changed

5 files changed

+20
-26
lines changed

internal/gatewayapi/testdata/securitypolicy-with-extauth-backendrefs.out.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ xdsIR:
238238
- path: /dev/stdout
239239
http:
240240
- address: 0.0.0.0
241+
externalPort: 80
241242
hostnames:
242243
- '*'
243244
isHTTP2: false

internal/gatewayapi/testdata/securitypolicy-with-oidc-backendrefs.out.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ xdsIR:
206206
- path: /dev/stdout
207207
http:
208208
- address: 0.0.0.0
209+
externalPort: 80
209210
hostnames:
210211
- '*'
211212
isHTTP2: false

internal/xds/translator/listener.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,7 @@ func (t *Translator) addHCMToXDSListener(
482482
}
483483
filterChain.TransportSocket = tSocket
484484

485-
err := addServerNamesMatch(xdsListener, filterChain, irListener.Hostnames)
486-
if err != nil {
485+
if err := addServerNamesMatch(xdsListener, filterChain, irListener.Hostnames); err != nil {
487486
return err
488487
}
489488

@@ -705,12 +704,7 @@ func (t *Translator) addXdsTCPFilterChain(
705704
}
706705

707706
if isTLSPassthrough {
708-
err := addServerNamesMatch(
709-
xdsListener,
710-
filterChain,
711-
irRoute.TLS.TLSInspectorConfig.SNIs,
712-
)
713-
if err != nil {
707+
if err := addServerNamesMatch(xdsListener, filterChain, irRoute.TLS.TLSInspectorConfig.SNIs); err != nil {
714708
return err
715709
}
716710
}
@@ -720,12 +714,7 @@ func (t *Translator) addXdsTCPFilterChain(
720714
if cfg := irRoute.TLS.TLSInspectorConfig; cfg != nil {
721715
snis = cfg.SNIs
722716
}
723-
err := addServerNamesMatch(
724-
xdsListener,
725-
filterChain,
726-
snis,
727-
)
728-
if err != nil {
717+
if err := addServerNamesMatch(xdsListener, filterChain, snis); err != nil {
729718
return err
730719
}
731720
tSocket, err := buildXdsDownstreamTLSSocket(irRoute.TLS.Terminate)

internal/xds/translator/translator.go

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -489,13 +489,6 @@ func (t *Translator) addRouteToRouteConfig(
489489
err error
490490
)
491491

492-
// If the virtual host already exists, we can skip it.
493-
for _, vHost := range xdsRouteCfg.VirtualHosts {
494-
if vHost.Name == virtualHostName(httpListener, vHost.Domains[0]) {
495-
vHosts[vHost.Domains[0]] = vHost
496-
}
497-
}
498-
499492
// Check if an extension is loaded that wants to modify xDS Routes after they have been generated
500493
for _, httpRoute := range httpListener.Routes {
501494
// 1:1 between IR HTTPRoute Hostname and xDS VirtualHost.
@@ -793,8 +786,13 @@ func (t *Translator) processTCPListenerXdsTranslation(
793786
}
794787
}
795788
if err := t.addXdsTCPFilterChain(
796-
xdsListener, route, route.Destination.Name, accesslog,
797-
tcpListener.Timeout, tcpListener.Connection); err != nil {
789+
xdsListener,
790+
route,
791+
route.Destination.Name,
792+
accesslog,
793+
tcpListener.Timeout,
794+
tcpListener.Connection,
795+
); err != nil {
798796
errs = errors.Join(errs, err)
799797
}
800798
}
@@ -815,8 +813,13 @@ func (t *Translator) processTCPListenerXdsTranslation(
815813
},
816814
}
817815
if err := t.addXdsTCPFilterChain(
818-
xdsListener, emptyRoute, emptyClusterName, accesslog,
819-
tcpListener.Timeout, tcpListener.Connection); err != nil {
816+
xdsListener,
817+
emptyRoute,
818+
emptyClusterName,
819+
accesslog,
820+
tcpListener.Timeout,
821+
tcpListener.Connection,
822+
); err != nil {
820823
errs = errors.Join(errs, err)
821824
}
822825
}

test/e2e/tests/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ func IsGatewayNamespaceMode() bool {
736736

737737
// TODO(zhaohuabing) remove this after the feature flag is removed.
738738
func XDSNameSchemeV2() bool {
739-
return DeployProfile == "pxds-name-scheme-v2"
739+
return DeployProfile == "xds-name-scheme-v2"
740740
}
741741

742742
func GetGatewayResourceNamespace() string {

0 commit comments

Comments
 (0)