envoyproxy / envoyproxy/envoy

Make it easy to 'inherit' config for filters (listener->vhost->route)

Open
#25,903 5 comments 0 reactions 1 assignee Claimed by @ravenblackx View on GitHub
area/ecds area/http_filter enhancement no stalebot
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 20h
Merged PRs (30d)
437

Description

The current model of filter config is we *usually* do a complete override of the parent config when we add a vhost or route config. The reason for this is not an aesthetic or intentional one, but rather that the current implementation makes inheritance-based configuration unwieldy and unperformant. It's also impossible to correctly verify that the merged/inherited config is valid at config-time; we don't have access to the merged config until the filter begins work.

For example, see [FileSystemBufferFilterMergedConfig](https://github.com/envoyproxy/envoy/blob/7974560b04172e21999ecd1103f9960b5d2899d4/source/extensions/filters/http/file_system_buffer/filter_config.h#L60-L102) - a horrifying thing that has to be reconstructed for each filter instance.

The premise of this issue is to make it so that during `createRouteSpecificFilterConfigTyped`, we have access to the parent config protos, and thereby can perform a merge relatively easily, just once, at config-time, including validation.

One possible wrinkle with this idea is in a case where the config looks like
```
listener {
httpfilter{ecds_dynamic_my_filter},
vhost {
route {
httpfilter{my_filter{x:1, y:2}}
}
}
}
```
An update to the dynamic config in this context may not automatically re-call `createRouteSpecificFilterConfigTyped` for the potentially-impacted 'child' filters (e.g. a hypothetical change from z:3 to z:4 should update both versions of the config), so it may be necessary to also explicitly do that as part of this change.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.