Skip to content

Commit

Permalink
remove empty tls
Browse files Browse the repository at this point in the history
Signed-off-by: zirain <zirain2009@gmail.com>
  • Loading branch information
zirain committed May 13, 2024
1 parent 115fdb1 commit 9084108
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 14 deletions.
10 changes: 7 additions & 3 deletions internal/gatewayapi/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -1064,9 +1064,13 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour
accepted = true
irKey := t.getIRKey(listener.gateway)

tls := ir.TLS{
Terminate: irTLSConfigs(listener.tlsSecrets),
var tls *ir.TLS
if len(listener.tlsSecrets) > 0 {
tls = &ir.TLS{
Terminate: irTLSConfigs(listener.tlsSecrets),
}
}

if listener.Hostname != nil {
tls.TLSInspectorConfig = &ir.TLSInspectorConfig{
SNIs: []string{string(*listener.Hostname)},
Expand All @@ -1081,7 +1085,7 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour
Name: irRouteDestinationName(tcpRoute, -1 /*rule index*/),
Settings: destSettings,
},
TLS: &tls,
TLS: tls,
}
irListener.Routes = append(irListener.Routes, irRoute)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ xdsIR:
maxConnectionDuration: 17s
tcp:
connectTimeout: 15s
tls: {}
udp:
- address: 0.0.0.0
destination:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ xdsIR:
maxConnectionDuration: 17s
tcp:
connectTimeout: 15s
tls: {}
udp:
- address: 0.0.0.0
destination:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,3 @@ xdsIR:
settings:
- weight: 1
name: tcproute/default/tcproute-1
tls: {}
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,3 @@ xdsIR:
protocol: TCP
weight: 50
name: tcproute/default/tcproute-1
tls: {}
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,3 @@ xdsIR:
protocol: TCP
weight: 1
name: tcproute/default/tcproute-1
tls: {}
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,3 @@ xdsIR:
protocol: TCP
weight: 1
name: tcproute/default/tcproute-1
tls: {}
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,3 @@ xdsIR:
protocol: TCP
weight: 1
name: tcproute/default/tcproute-1
tls: {}
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ xdsIR:
protocol: TCP
weight: 1
name: tcproute/default/tcproute-1
tls: {}
- address: 0.0.0.0
name: envoy-gateway/gateway-1/tcp2
port: 10163
Expand All @@ -189,4 +188,3 @@ xdsIR:
protocol: TCP
weight: 1
name: tcproute/default/tcproute-2
tls: {}
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ xdsIR:
protocol: TCP
weight: 1
name: tcproute/default/tcproute-1
tls: {}
- address: 0.0.0.0
name: envoy-gateway/gateway-1/tcp2
port: 10162
Expand All @@ -185,4 +184,3 @@ xdsIR:
protocol: TCP
weight: 1
name: tcproute/default/tcproute-1
tls: {}

0 comments on commit 9084108

Please sign in to comment.