Support sanity checking of extension configuration without requiring all dependencies
- Dominant language
- C++
- Stars
- 28.9k
- Forks
- 5.6k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 430
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:
1. make `Envoy::Server::Options` available to ResourceMonitorFactoryContext and FilterFactoryContext and optionally other factory contexts
1. clarify the contract between, or at least the documentation of, the various Mode options
Contributor guide
Assessment
This issue has not been assessed yet.