Support sanity checking of extension configuration without requiring all dependencies
#15 032 ouverte le 11 févr. 2021
Métriques du dépôt
- Stars
- (27 997 stars)
- Métriques de merge PR
- (Merge moyen 8j) (378 PRs mergées en 30 j)
Description
I want to deploy my Envoys using my custom FooFilter attached to a static listener. FooFilter has a custom configuration with some fields that must be set, with cross-field dependencies (specifically things that can't be checked using PGV annotations). I want to verify that as I add and remove fields, my checked-in bootstrap configs are still valid.
In a world in which all abstractions are correct, my development environment would perfectly mirror production and there would be no difference in instantiating FooFilter for validation versus execution. This seems like an unreasonable expectation, though, so instead I would like my FooFilter to be able to know somehow whether it should actually expect to find all its dependencies or just sanity check its config to the best of its ability.
Right now, Envoy has a notion of execution versus validation modes, available via Envoy::Server::Options::mode(). Mode::Validate seems closes to what I want. The implicit contract seems to be that if Mode::Validate produces errors, then any other mode will also produce errors (but not the reverse). Extensions have access to information about the current context via the various .*FactoryContext interfaces, but Options is not exposed.
This feature request is two-fold:
- make
Envoy::Server::Optionsavailable to ResourceMonitorFactoryContext and FilterFactoryContext and optionally other factory contexts - clarify the contract between, or at least the documentation of, the various Mode options