-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a flag to test configuration file #499
Comments
@kyessenov this seems useful. Right now, we use mocks to verify configurations in the test code: We do not want to depend on gmock in the prod code. Will need to figure out how to do a verification pass without using mocks which might involve some targeted changes throughout various portions of the code. |
@rlazarus is taking this one. |
Related: #538 |
It would be nice to verify RDS and CDS configs as well since the base config can be fairly small and most of it is fetched dynamically. |
@kyessenov +1 one we need that also. cc @junr03 |
This adds a --mode command-line flag. "--mode=serve" is the default and can be omitted; in that mode Envoy runs as it always has. With "--mode=validate" Envoy checks that the configuration file in --config-file is valid, then exits. "Valid" means that it performs the JSON schema check as usual, but also initializes as much of its internal state as possible, exiting with any errors as it would under "--mode=serve". When initialization is complete, instead of listening for traffic, Envoy prints an "OK" message to stderr and exits, returning success. In validation mode, to the extent possible, Envoy avoids interfering with its environment. For example, the hot-restart process is skipped, so validation can safely be run on the same machine as a serving Envoy. Validation mode also doesn't send any upstream traffic or open any listeners. It *does* attempt to read any files referenced in the config, like certs and private keys, so validation will fail if those files aren't located at the expected paths. A future "lite validation" mode, that mocks out the filesystem as well as the network, is not yet implemented as of this patch.
This adds a --mode command-line flag. --mode=serve is the default and can be omitted; in that mode Envoy runs as it always has. With --mode=validate Envoy checks that the configuration file in --config-file is valid, then exits. "Valid" means that it performs the JSON schema check as usual, but also initializes as much of its internal state as possible, exiting with any errors as it would under --mode=serve. When initialization is complete, instead of listening for traffic, Envoy prints an "OK" message to stderr and exits, returning success. In validation mode, to the extent possible, Envoy avoids interfering with its environment. For example, the hot-restart process is skipped, so validation can safely be run on the same machine as a serving Envoy. Validation mode also doesn't send any upstream traffic or open any listeners. It does attempt to read any files referenced in the config, like certs and private keys, so validation will fail if those files aren't located at the expected paths. A future "lite validation" mode, that mocks out the filesystem as well as the network, is not yet implemented as of this patch.
Going to close this out as the initial impl is done. We can open new issues with new requests. |
…oxy#499) Handle spdlog::level::off by returning WasmResult::Ok; Signed-off-by: John Plevyak <[email protected]>
I think it would be useful to add a flag to test validity of the configuration JSON file.
Something similar to "-t" flag in nginx.
The text was updated successfully, but these errors were encountered: