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

options: Allow OptionsImpl to be constructed from a vector #9147

Merged
merged 4 commits into from
Nov 29, 2019

Conversation

akonradi
Copy link
Contributor

This gives better type safety, and is no less efficient since the
overload of TCLAP::CmdLine::parse that takes in argc and argv performs
the same copy into a std::vector internally. Adding this constructor
gives more flexibility to creators of OptionsImpl instances.

Risk Level: low
Testing: ran unit tests
Docs Changes: n/a
Release Notes: n/a

This gives better type safety, and is no less efficient since the
overload of TCLAP::CmdLine::parse that takes in argc and argv performs
the same copy into a std::vector internally. Adding this constructor
just gives more flexibility to creators of OptionsImpl instances.

Signed-off-by: Alex Konradi <akonradi@google.com>
@zuercher
Copy link
Member

/azp run envoy-linux

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@zuercher zuercher self-assigned this Nov 26, 2019
@zuercher
Copy link
Member

Thanks. I re-started the tests since the tsan failure is a known flake. Otherwise, looks good.

Copy link
Member

@zuercher zuercher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again. One small thing and we’re good to go.

source/server/options_impl.cc Outdated Show resolved Hide resolved
camelCase, not PascalCase

Signed-off-by: Alex Konradi <akonradi@google.com>
Don't rely on the implementation of the argv/argn constructor on top of
the constructor that takes a vector. Have explicit tests of both,
and validate the usage of argn to limit the number of elements of argv
that are parsed.

Signed-off-by: Alex Konradi <akonradi@google.com>
yanavlasov
yanavlasov previously approved these changes Nov 27, 2019
Signed-off-by: Alex Konradi <akonradi@google.com>
Copy link
Member

@zuercher zuercher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mattklein123 mattklein123 merged commit 85bba59 into envoyproxy:master Nov 29, 2019
@akonradi akonradi deleted the options-vector-args branch December 2, 2019 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants