allow specifying the API version of bootstrap from the command line#10803
allow specifying the API version of bootstrap from the command line#10803htuch merged 18 commits intoenvoyproxy:masterfrom
Conversation
|
Just wanted to put something up to see if we think this is the right kind of approach, there are a few issues currently:
|
include/envoy/server/options.h
Outdated
There was a problem hiding this comment.
Should it just be an integer, since we won't have non-integer major versions?
source/common/protobuf/utility.cc
Outdated
There was a problem hiding this comment.
The repetition with the code below might support refactoring if we go down this path.
source/server/server.cc
Outdated
There was a problem hiding this comment.
Yeah, I agree this is a bit ungraceful. I think the alternative is we supply to loadFromJson etc. the type URL of the bootstrap that we know exists on the filesystem, e.g. envoy.config.bootstrap.v2. We can do that mapping here.
Then, we load JSON specifically into a message that we build from reflection with that type. We then have a v2 bootstrap message. Following this, we do a VersionConverter::upgrade to the v3 bootstrap Envoy is using internally. LMK if you need more details on this, we have some examples of each of these things around.
There was a problem hiding this comment.
That makes sense to me, it's along the lines of what I had in mind as well for a way doing this by bypassing the whole withApiBoosting helper. I'll give that a go and see how it goes
htuch
left a comment
There was a problem hiding this comment.
Generally looks great, it's pretty easy to understand now..
/wait
source/common/protobuf/utility.h
Outdated
source/common/protobuf/utility.cc
Outdated
There was a problem hiding this comment.
Does this still need to be rewritten?
source/server/server.cc
Outdated
There was a problem hiding this comment.
Nit: prefer not explicitly state captures.
test/server/server_test.cc
Outdated
There was a problem hiding this comment.
Should there be some positive tests as well for explicit version CLI?
test/common/protobuf/utility_test.cc
Outdated
There was a problem hiding this comment.
Should this use a strict validator and reject?
|
Huh for some reason DCO is broken on one of the commits. I'll fix once this is approved |
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
Signed-off-by: Snow Pettersen <kpettersen@netflix.com>
test/server/server_test.cc
Outdated
| } | ||
|
|
||
| // Validate that we correctly parse a V2 file when configured to do so. | ||
| TEST_P(ServerInstanceImplTest, LoadsV2ConfigWhenV2SelectedFromPbText) { |
There was a problem hiding this comment.
Hmm this seems to fail under compile_time_options with
[ RUN ] IpVersions/ServerInstanceImplTest.LoadsV2ConfigWhenV2SelectedFromPbText/IPv4
[libprotobuf WARNING external/com_google_protobuf/src/google/protobuf/text_format.cc:324] Warning parsing text-format envoy.config.bootstrap.v2.Bootstrap: 4:1: text format contains deprecated field "build_version"
[2020-04-22 05:18:57.856][17][critical][main] [external/envoy/source/server/server.cc:98] error initializing configuration '/b/f/w/_tmp/fa9accb9e25432420d3f5adcb6c78680/valid_v2_but_invalid_v3_bootstrap.pb_text.with.ports.pb_text': Proto constraint validation failed (Using deprecated option 'envoy.api.v2.core.Node.build_version' from file base.proto. This configuration will be removed from Envoy soon. Please see https://www.envoyproxy.io/docs/envoy/latest/intro/deprecated for details. If continued use of this field is absolutely necessary, see https://www.envoyproxy.io/docs/envoy/latest/configuration/operations/runtime#using-runtime-overrides-for-deprecated-features for how to apply a temporary and highly discouraged override.): id: "bootstrap_id"
build_version: "foo"
unknown file: Failure
C++ exception with description "Proto constraint validation failed (Using deprecated option 'envoy.api.v2.core.Node.build_version' from file base.proto. This configuration will be removed from Envoy soon. Please see https://www.envoyproxy.io/docs/envoy/latest/intro/deprecated for details. If continued use of this field is absolutely necessary, see https://www.envoyproxy.io/docs/envoy/latest/configuration/operations/runtime#using-runtime-overrides-for-deprecated-features for how to apply a temporary and highly discouraged override.): id: "bootstrap_id"
build_version: "foo"
" thrown in the test body.
[ FAILED ] IpVersions/ServerInstanceImplTest.LoadsV2ConfigWhenV2SelectedFromPbText/IPv4, where GetParam() = 4-byte object <00-00 00-00> (4 ms)
presumably since we run the test with --disabled-features=disabled. Thoughts on how to make this test work @htuch ?
There was a problem hiding this comment.
Can this be a DEPRECATED_FEATURE_TEST?
There was a problem hiding this comment.
Yep this worked, thanks!
Signed-off-by: Snow Pettersen <aickck@gmail.com>
Signed-off-by: Snow Pettersen <aickck@gmail.com>
Signed-off-by: Spencer Lewis <slewis@squareup.com> * master: (46 commits) allow specifying the API version of bootstrap from the command line (envoyproxy#10803) config: adding connect matcher (unused) (envoyproxy#10894) Add missing dependency on `assert.h` (envoyproxy#10918) Lower heap and disk space used by kafka tests (envoyproxy#10915) [tools] handle commits merged without PR in deprecated script (envoyproxy#10723) tools: including working tree in modified_since_last_github_commit.sh diff. (envoyproxy#10911) rocketmq_proxy: implement rocketmq proxy [docs] PR template to include commit message (envoyproxy#10900) docs: breaking long word to stop content overflow. (envoyproxy#10880) Delete legacy connection pool code. (envoyproxy#10881) wasm: clarify how configuration is passed (envoyproxy#10782) issue template: clarify security/crash reporting (envoyproxy#10885) api/faq: add entry on incremental xDS. (envoyproxy#10876) router: retry overloaded requests (envoyproxy#10847) Remove inclusion of pthread.h, not needed for linux compilation (envoyproxy#10895) request_id: Add option to always set request id in response (envoyproxy#10808) xray: Use correct types for segment document output (envoyproxy#10834) router: fixing a watermark bug for streaming retries (envoyproxy#10866) http: auditing Path() calls for safety with Pathless CONNECT (envoyproxy#10851) Remove hardcoded type urls Part.2 (envoyproxy#10848) ...
|
FYI @snowp, I'm running |
Adds a
--boostrap_versionflag that can be used to determine which API version the bootstrap should be parsed as.Risk Level: Low
Testing: UTs
Docs Changes: Flag docs
Release Notes: n/a
Fixes #10343