Refactor SecretManagerImpl to templatize findOrCreate method.#4448
Merged
htuch merged 3 commits intoenvoyproxy:masterfrom Sep 18, 2018
Merged
Refactor SecretManagerImpl to templatize findOrCreate method.#4448htuch merged 3 commits intoenvoyproxy:masterfrom
htuch merged 3 commits intoenvoyproxy:masterfrom
Conversation
Signed-off-by: JimmyCYJ <jimmychen.0102@gmail.com>
Member
Author
qiwzhang
reviewed
Sep 18, 2018
| std::shared_ptr<SecretType> findOrCreate( | ||
| const envoy::api::v2::core::ConfigSource& sds_config_source, const std::string& config_name, | ||
| std::function<std::shared_ptr<SecretType>(std::function<void()> unregister_secret_provider)> | ||
| create_fn) { |
Contributor
There was a problem hiding this comment.
not to pass in create_fn. The creation can be done in this template class.
Signed-off-by: JimmyCYJ <jimmychen.0102@gmail.com>
qiwzhang
reviewed
Sep 18, 2018
| }; | ||
| TlsCertificateSdsApiSharedPtr secret_provider = | ||
| certificate_providers_.findOrCreate(sds_config_source, config_name, create_fn); | ||
| certificate_providers_.findOrCreate(sds_config_source, config_name, secret_provider_context); |
Contributor
There was a problem hiding this comment.
not need a separate variable
Signed-off-by: JimmyCYJ <jimmychen.0102@gmail.com>
lizan
approved these changes
Sep 18, 2018
Member
Author
|
Thanks a lot for reviewing this PR. |
htuch
approved these changes
Sep 18, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: JimmyCYJ jimmychen.0102@gmail.com
Description: According to comment in PR #4355, we want to avoid std::dynamic_pointer_cast in SecretManagerImpl. This PR creates a template class and moves findOrCreate method into the template class.
Risk Level: Low
Testing: Existing unit tests and integration tests.