envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.28k stars 4.69k forks source link

deprecate canonical filter name downgrading in the per filter config searching #29461

Open wbpcode opened 10 months ago

wbpcode commented 10 months ago

The typed_per_filter_config (/route level/virtual host level/route config level/), see https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto for more detail) field can be used to provide additional /route config-specific/virtual host-specific/route-specific/ configurations for filters.

The typed_per_filter_config is a map and the key should match the filter config name in the http_filters. See https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto#envoy-v3-api-msg-extensions-filters-network-http-connection-manager-v3-httpfilter

For example, given following http filter config:

  http_filters:
  - name: custom-buffer-filter
    typed_config: { ... }

The custom-buffer-filter will be used as the key to lookup the per filter config. If no related entry is found by the key, we will downgrade to try the canonical filter name envoy.filters.http.buffer.

This downgrading is for backward compatibility and could be disabled by setting the runtime flag envoy.reloadable_features.no_downgrade_to_canonical_name to true explicitly.

And we will flip the default value of envoy.reloadable_features.no_downgrade_to_canonical_name to true after 2023 Q4 release.

wbpcode commented 10 months ago

If you use canonical filter name (for example, envoy.filters.http.router or envoy.filters.http.lua) as filter config name:

http_filters:
- name: envoy.filters.http.lua
  typed_config: { ... }
- name: envoy.filters.http.buffer
  typed_config: { ... }

Then you can ignore this change safely.

If you use custom name as filter config name and the typed_per_filter_config is also indexed with the related custom name:

http_filters:
- name: custom-lua
  typed_config: { ... }
- name: custom-buffer
  typed_config: { ... }

...

typed_per_filter_config:
  "custom-lua":
    { ... }
  "custom-buffer":
    { ... }

Then you can also ignore this change safely.

If you use custom name as filter config name and the canonical filter name is used as typed_per_filter_config index for same filter:

http_filters:
- name: custom-lua
  typed_config: { ... }
- name: custom-buffer
  typed_config: { ... }

...

typed_per_filter_config:
  "envoy.filters.http.lua":  # error
    { ... }
  "custom-buffer":  # ok
    { ... }

Please update your config to keep the filter config name and index key of typed_per_filter_config same.

github-actions[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.