-
Notifications
You must be signed in to change notification settings - Fork 5.5k
config: making v2-config-only a boolean flag #3847
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,12 +60,32 @@ TEST(OptionsImplTest, InvalidCommandLine) { | |
| "Couldn't find match for argument"); | ||
| } | ||
|
|
||
| TEST(OptionsImplTest, v2True) { | ||
| std::unique_ptr<OptionsImpl> options = createOptionsImpl( | ||
| "envoy --mode validate --concurrency 2 -c hello --admin-address-path path --restart-epoch 1 " | ||
| "--local-address-ip-version v6 -l info --service-cluster cluster --service-node node " | ||
| "--service-zone zone --file-flush-interval-msec 9000 --drain-time-s 60 --log-format [%v] " | ||
| "--parent-shutdown-time-s 90 --log-path /foo/bar --v2-config-only 1 --disable-hot-restart"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tclap only supports 0/1 rather than false/true? We might want to use an independent flag to avoid breaking folks production equivalent of Borg config.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I tested and true/false chokes. I was tempted to do a string literal true/false but I figured folks use to TCLAP rather than google flags would find that more confusing
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also I'm open to just adding a second flag but if the concern is folks who want v2 only will have it specified, we're going to break them eventually when we remove v1 config and the flag. Is it worth adding the complexity of a second flag to avoid a problem they're going to face in a few months anyway?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO we should add a second flag and not change this one (basically make it do nothing since the default is already what it implies). I think this is less likely to break people? |
||
| EXPECT_EQ(Server::Mode::Validate, options->mode()); | ||
| EXPECT_TRUE(options->v2ConfigOnly()); | ||
| } | ||
|
|
||
| TEST(OptionsImplTest, v2False) { | ||
| std::unique_ptr<OptionsImpl> options = createOptionsImpl( | ||
| "envoy --mode validate --concurrency 2 -c hello --admin-address-path path --restart-epoch 1 " | ||
| "--local-address-ip-version v6 -l info --service-cluster cluster --service-node node " | ||
| "--service-zone zone --file-flush-interval-msec 9000 --drain-time-s 60 --log-format [%v] " | ||
| "--parent-shutdown-time-s 90 --log-path /foo/bar --v2-config-only 0 --disable-hot-restart"); | ||
| EXPECT_EQ(Server::Mode::Validate, options->mode()); | ||
| EXPECT_FALSE(options->v2ConfigOnly()); | ||
| } | ||
|
|
||
| TEST(OptionsImplTest, All) { | ||
| std::unique_ptr<OptionsImpl> options = createOptionsImpl( | ||
| "envoy --mode validate --concurrency 2 -c hello --admin-address-path path --restart-epoch 1 " | ||
| "--local-address-ip-version v6 -l info --service-cluster cluster --service-node node " | ||
| "--service-zone zone --file-flush-interval-msec 9000 --drain-time-s 60 --log-format [%v] " | ||
| "--parent-shutdown-time-s 90 --log-path /foo/bar --v2-config-only --disable-hot-restart"); | ||
| "--parent-shutdown-time-s 90 --log-path /foo/bar --v2-config-only 0 --disable-hot-restart"); | ||
| EXPECT_EQ(Server::Mode::Validate, options->mode()); | ||
| EXPECT_EQ(2U, options->concurrency()); | ||
| EXPECT_EQ("hello", options->configPath()); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: leave line break