Skip to content
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

Closed
kyessenov opened this issue Feb 18, 2017 · 7 comments
Closed

Add a flag to test configuration file #499

kyessenov opened this issue Feb 18, 2017 · 7 comments
Assignees
Labels
enhancement Feature requests. Not bugs or questions.
Milestone

Comments

@kyessenov
Copy link
Contributor

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.

@mattklein123
Copy link
Member

@kyessenov this seems useful. Right now, we use mocks to verify configurations in the test code:
https://github.com/lyft/envoy/blob/master/test/example_configs_test.cc

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.

@mattklein123 mattklein123 added enhancement Feature requests. Not bugs or questions. help wanted labels Feb 22, 2017
@mattklein123
Copy link
Member

@rlazarus is taking this one.

@tschroed
Copy link
Contributor

tschroed commented Mar 5, 2017

Related: #538

@mattklein123
Copy link
Member

FYI, we need something like this pretty soon for our internal tooling. @rlazarus where are you on this? Can @junr03 help out? Another short term option is to just build a separate binary similar to what @hennna did using the full mocks.

@kyessenov
Copy link
Contributor Author

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.

@mattklein123
Copy link
Member

@kyessenov +1 one we need that also. cc @junr03

rlazarus pushed a commit to rlazarus/envoy that referenced this issue Apr 28, 2017
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.
@mattklein123 mattklein123 modified the milestones: 1.3.0, 1.4.0 May 11, 2017
htuch pushed a commit that referenced this issue May 26, 2017
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.
@mattklein123
Copy link
Member

Going to close this out as the initial impl is done. We can open new issues with new requests.

lizan pushed a commit to lizan/envoy that referenced this issue Jun 4, 2020
…oxy#499)

Handle spdlog::level::off by returning WasmResult::Ok;

Signed-off-by: John Plevyak <[email protected]>
wolfguoliang pushed a commit to wolfguoliang/envoy that referenced this issue Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests. Not bugs or questions.
Projects
None yet
Development

No branches or pull requests

4 participants