Skip to content

Commit 800141b

Browse files
committed
address Arko's comment
Signed-off-by: zirain <[email protected]>
1 parent ef739cb commit 800141b

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

internal/xds/translator/translator.go

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -819,22 +819,9 @@ func (t *Translator) processTCPListenerXdsTranslation(
819819
errs = errors.Join(errs, err)
820820
}
821821
}
822-
}
823-
if err := t.addXdsTCPFilterChain(
824-
xdsListener,
825-
route,
826-
route.Destination.Name,
827-
accesslog,
828-
tcpListener.Timeout,
829-
tcpListener.Connection,
830-
); err != nil {
831-
errs = errors.Join(errs, err)
832-
}
833-
}
834-
835-
// add TCPRoute client certs
836-
for _, route := range tcpListener.Routes {
837-
if route.Destination != nil {
822+
} else if route.Destination != nil {
823+
// TCPRoute with BackendTLSPolicy
824+
// add tcp route client certs
838825
for _, st := range route.Destination.Settings {
839826
if st.TLS != nil {
840827
for _, clientCert := range st.TLS.ClientCertificates {
@@ -846,6 +833,16 @@ func (t *Translator) processTCPListenerXdsTranslation(
846833
}
847834
}
848835
}
836+
if err := t.addXdsTCPFilterChain(
837+
xdsListener,
838+
route,
839+
route.Destination.Name,
840+
accesslog,
841+
tcpListener.Timeout,
842+
tcpListener.Connection,
843+
); err != nil {
844+
errs = errors.Join(errs, err)
845+
}
849846
}
850847

851848
// If there are no routes, add a route without a destination to the listener to create a filter chain

0 commit comments

Comments
 (0)