envoy: migrate deprecated overload setting (#5082)

Migrate from overload.global_downstream_max_connections to the suggested
envoy.resource_monitors.global_downstream_max_connections replacement.
This commit is contained in:
Kenneth Jenkins 2024-04-22 18:53:24 -07:00 committed by GitHub
parent cc0a989cc0
commit 05e077fe04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 40 additions and 6 deletions

View file

@ -41,9 +41,6 @@ func TestBuilder_BuildBootstrapLayeredRuntime(t *testing.T) {
{ "layers": [{
"name": "static_layer_0",
"staticLayer": {
"overload": {
"global_downstream_max_connections": 50000
},
"re2": {
"max_program_size": {
"error_level": 1048576,
@ -126,3 +123,28 @@ func TestBuilder_BuildBootstrapStatsConfig(t *testing.T) {
`, statsCfg)
})
}
func TestBuilder_BuildBootstrap(t *testing.T) {
b := New("localhost:1111", "localhost:2222", "localhost:3333", filemgr.NewManager(), nil)
t.Run("OverloadManager", func(t *testing.T) {
bootstrap, err := b.BuildBootstrap(context.Background(), &config.Config{
Options: &config.Options{
EnvoyAdminAddress: "localhost:9901",
},
}, false)
assert.NoError(t, err)
testutil.AssertProtoJSONEqual(t, `
{
"resourceMonitors": [
{
"name": "envoy.resource_monitors.global_downstream_max_connections",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.resource_monitors.downstream_connections.v3.DownstreamConnectionsConfig",
"maxActiveDownstreamConnections": "50000"
}
}
]
}
`, bootstrap.OverloadManager)
})
}