-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid panic applying TProxy Envoy extensions (#17537)
When UpstreamEnvoyExtender was introduced, some code was left duplicated between it and BasicEnvoyExtender. One path in that code panics when a TProxy listener patch is attempted due to no upstream data in RuntimeConfig matching the local service (which would only happen in rare cases). Instead, we can remove the special handling of upstream VIPs from BasicEnvoyExtender entirely, greatly simplifying the listener filter patch code and avoiding the panic. UpstreamEnvoyExtender, which needs this code to function, is modified to ensure a panic does not occur. This also fixes a second regression in which the Lua extension was not applied to TProxy outbound listeners.
- Loading branch information
Showing
9 changed files
with
928 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
315 changes: 315 additions & 0 deletions
315
...a/builtin_extension/clusters/lua-outbound-applies-to-local-upstreams-tproxy.latest.golden
Large diffs are not rendered by default.
Oops, something went wrong.
163 changes: 163 additions & 0 deletions
163
.../builtin_extension/endpoints/lua-outbound-applies-to-local-upstreams-tproxy.latest.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
{ | ||
"versionInfo": "00000001", | ||
"resources": [ | ||
{ | ||
"@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", | ||
"clusterName": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul", | ||
"endpoints": [ | ||
{ | ||
"lbEndpoints": [ | ||
{ | ||
"endpoint": { | ||
"address": { | ||
"socketAddress": { | ||
"address": "10.10.1.1", | ||
"portValue": 8080 | ||
} | ||
} | ||
}, | ||
"healthStatus": "HEALTHY", | ||
"loadBalancingWeight": 1 | ||
}, | ||
{ | ||
"endpoint": { | ||
"address": { | ||
"socketAddress": { | ||
"address": "10.10.1.2", | ||
"portValue": 8080 | ||
} | ||
} | ||
}, | ||
"healthStatus": "HEALTHY", | ||
"loadBalancingWeight": 1 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", | ||
"clusterName": "destination.192-168-2-1.kafka.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul", | ||
"endpoints": [ | ||
{ | ||
"lbEndpoints": [ | ||
{ | ||
"endpoint": { | ||
"address": { | ||
"socketAddress": { | ||
"address": "172.168.0.1", | ||
"portValue": 8443 | ||
} | ||
} | ||
}, | ||
"healthStatus": "HEALTHY", | ||
"loadBalancingWeight": 1 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", | ||
"clusterName": "destination.192-168-2-2.kafka2.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul", | ||
"endpoints": [ | ||
{ | ||
"lbEndpoints": [ | ||
{ | ||
"endpoint": { | ||
"address": { | ||
"socketAddress": { | ||
"address": "172.168.0.1", | ||
"portValue": 8443 | ||
} | ||
} | ||
}, | ||
"healthStatus": "HEALTHY", | ||
"loadBalancingWeight": 1 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", | ||
"clusterName": "destination.192-168-2-3.kafka2.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul", | ||
"endpoints": [ | ||
{ | ||
"lbEndpoints": [ | ||
{ | ||
"endpoint": { | ||
"address": { | ||
"socketAddress": { | ||
"address": "172.168.0.1", | ||
"portValue": 8443 | ||
} | ||
} | ||
}, | ||
"healthStatus": "HEALTHY", | ||
"loadBalancingWeight": 1 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", | ||
"clusterName": "destination.www-google-com.google.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul", | ||
"endpoints": [ | ||
{ | ||
"lbEndpoints": [ | ||
{ | ||
"endpoint": { | ||
"address": { | ||
"socketAddress": { | ||
"address": "172.168.0.1", | ||
"portValue": 8443 | ||
} | ||
} | ||
}, | ||
"healthStatus": "HEALTHY", | ||
"loadBalancingWeight": 1 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", | ||
"clusterName": "geo-cache.default.dc1.query.11111111-2222-3333-4444-555555555555.consul", | ||
"endpoints": [ | ||
{ | ||
"lbEndpoints": [ | ||
{ | ||
"endpoint": { | ||
"address": { | ||
"socketAddress": { | ||
"address": "10.10.1.1", | ||
"portValue": 8080 | ||
} | ||
} | ||
}, | ||
"healthStatus": "HEALTHY", | ||
"loadBalancingWeight": 1 | ||
}, | ||
{ | ||
"endpoint": { | ||
"address": { | ||
"socketAddress": { | ||
"address": "10.20.1.2", | ||
"portValue": 8080 | ||
} | ||
} | ||
}, | ||
"healthStatus": "HEALTHY", | ||
"loadBalancingWeight": 1 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"typeUrl": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", | ||
"nonce": "00000001" | ||
} |
Oops, something went wrong.