router: adding per-route upgrade config (#5034)

Allowing the HCM upgrades to be on or off by default, and adding per-route overrides to turn it off or on.

Risk Level: Medium (refactors existing code)
Testing: new unit and e2e tests
Docs Changes: proto docs
Release Notes: inline
Fixes #4921

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>

Mirrored from https://github.com/envoyproxy/envoy @ d72eaaf6d1905f7d478ab80cc7163684fc271fd9
pull/620/head
data-plane-api(CircleCI) 6 years ago
parent 180e729eb8
commit 7e1046a957
  1. 18
      envoy/api/v2/route/route.proto
  2. 5
      envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto

@ -406,7 +406,7 @@ message CorsPolicy {
google.protobuf.BoolValue enabled = 7;
}
// [#comment:next free field: 25]
// [#comment:next free field: 26]
message RouteAction {
oneof cluster_specifier {
option (validate.required) = true;
@ -757,6 +757,22 @@ message RouteAction {
// This can be used to prevent unexpected upstream request timeouts due to potentially long
// time gaps between gRPC request and response in gRPC streaming mode.
google.protobuf.Duration max_grpc_timeout = 23 [(gogoproto.stdduration) = true];
// Allows enabling and disabling upgrades on a per-route basis.
// This overrides any enabled/disabled upgrade filter chain specified in the
// HttpConnectionManager
// :ref:upgrade_configs`
// <envoy_api_field_config.filter.network.http_connection_manager.v2.HttpConnectionManager.upgrade_configs>`
// but does not affect any custom filter chain specified there.
message UpgradeConfig {
// The case-insensitive name of this upgrade, e.g. "websocket".
// For each upgrade type present in upgrade_configs, requests with
// Upgrade: [upgrade_type] will be proxied upstream.
string upgrade_type = 1;
// Determines if upgrades are available on this route. Defaults to true.
google.protobuf.BoolValue enabled = 2;
};
repeated UpgradeConfig upgrade_configs = 25;
}
message RedirectAction {

@ -353,6 +353,11 @@ message HttpConnectionManager {
// this type of upgrade. If no filters are present, the filter chain for
// HTTP connections will be used for this upgrade type.
repeated HttpFilter filters = 2;
// Determines if upgrades are enabled or disabled by default. Defaults to true.
// This can be overriden on a per-route basis with :ref:`cluster
// <envoy_api_field_route.RouteAction.upgrade_configs>` as documented in the
// :ref:`upgrade documentation <arch_overview_websocket>`.
google.protobuf.BoolValue enabled = 3;
};
repeated UpgradeConfig upgrade_configs = 23;

Loading…
Cancel
Save