KAFKA-8774: Regex can be found anywhere in config value#7197
Merged
rhauch merged 3 commits intoapache:trunkfrom Aug 13, 2019
Merged
KAFKA-8774: Regex can be found anywhere in config value#7197rhauch merged 3 commits intoapache:trunkfrom
rhauch merged 3 commits intoapache:trunkfrom
Conversation
Signed-off-by: Arjun Satish <arjun@confluent.io>
Contributor
Author
rhauch
reviewed
Aug 12, 2019
Contributor
rhauch
left a comment
There was a problem hiding this comment.
Great find, @wicknicks! I like the minimalist PR, but have a few suggestions for being a bit more thorough with the new unit tests.
Signed-off-by: Arjun Satish <arjun@confluent.io>
rhauch
approved these changes
Aug 13, 2019
Contributor
rhauch
left a comment
There was a problem hiding this comment.
LGTM, pending a green build. Thanks, @wicknicks!
Update system tests to cover case where config value contains additional characters besides secret that requires regex pattern to be found anywhere in the string (as opposed to complete match). Signed-off-by: Arjun Satish <arjun@confluent.io>
Contributor
Author
|
Updated a system test, here is a clean run https://jenkins.confluent.io/job/system-test-kafka-branch-builder/2884/ |
rhauch
approved these changes
Aug 13, 2019
Contributor
rhauch
left a comment
There was a problem hiding this comment.
Thanks for updating the system test. LGTM!
rhauch
pushed a commit
that referenced
this pull request
Aug 13, 2019
Corrected the AbstractHerder to correctly identify task configs that contain variables for externalized secrets. The original method incorrectly used `matcher.matches()` instead of `matcher.find()`. The former method expects the entire string to match the regex, whereas the second one can find a pattern anywhere within the input string (which fits this use case more correctly). Added unit tests to cover various cases of a config with externalized secrets, and updated system tests to cover case where config value contains additional characters besides secret that requires regex pattern to be found anywhere in the string (as opposed to complete match). Author: Arjun Satish <arjun@confluent.io> Reviewer: Randall Hauch <rhauch@gmail.com>
rhauch
pushed a commit
that referenced
this pull request
Aug 13, 2019
Corrected the AbstractHerder to correctly identify task configs that contain variables for externalized secrets. The original method incorrectly used `matcher.matches()` instead of `matcher.find()`. The former method expects the entire string to match the regex, whereas the second one can find a pattern anywhere within the input string (which fits this use case more correctly). Added unit tests to cover various cases of a config with externalized secrets, and updated system tests to cover case where config value contains additional characters besides secret that requires regex pattern to be found anywhere in the string (as opposed to complete match). Author: Arjun Satish <arjun@confluent.io> Reviewer: Randall Hauch <rhauch@gmail.com>
rhauch
pushed a commit
that referenced
this pull request
Aug 13, 2019
Corrected the AbstractHerder to correctly identify task configs that contain variables for externalized secrets. The original method incorrectly used `matcher.matches()` instead of `matcher.find()`. The former method expects the entire string to match the regex, whereas the second one can find a pattern anywhere within the input string (which fits this use case more correctly). Added unit tests to cover various cases of a config with externalized secrets, and updated system tests to cover case where config value contains additional characters besides secret that requires regex pattern to be found anywhere in the string (as opposed to complete match). Author: Arjun Satish <arjun@confluent.io> Reviewer: Randall Hauch <rhauch@gmail.com>
rhauch
pushed a commit
that referenced
this pull request
Aug 13, 2019
Corrected the AbstractHerder to correctly identify task configs that contain variables for externalized secrets. The original method incorrectly used `matcher.matches()` instead of `matcher.find()`. The former method expects the entire string to match the regex, whereas the second one can find a pattern anywhere within the input string (which fits this use case more correctly). Added unit tests to cover various cases of a config with externalized secrets, and updated system tests to cover case where config value contains additional characters besides secret that requires regex pattern to be found anywhere in the string (as opposed to complete match). Author: Arjun Satish <arjun@confluent.io> Reviewer: Randall Hauch <rhauch@gmail.com>
xiowu0
pushed a commit
to linkedin/kafka
that referenced
this pull request
Aug 22, 2019
… config value (apache#7197) TICKET = KAFKA-8774 LI_DESCRIPTION = EXIT_CRITERIA = HASH [b85707c] ORIGINAL_DESCRIPTION = Corrected the AbstractHerder to correctly identify task configs that contain variables for externalized secrets. The original method incorrectly used `matcher.matches()` instead of `matcher.find()`. The former method expects the entire string to match the regex, whereas the second one can find a pattern anywhere within the input string (which fits this use case more correctly). Added unit tests to cover various cases of a config with externalized secrets, and updated system tests to cover case where config value contains additional characters besides secret that requires regex pattern to be found anywhere in the string (as opposed to complete match). Author: Arjun Satish <arjun@confluent.io> Reviewer: Randall Hauch <rhauch@gmail.com> (cherry picked from commit b85707c)
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: Arjun Satish arjun@confluent.io
The original method incorrectly used matcher.matches() instead of matcher.find(). The former method expects the entire string to match the regex, whereas the second one can find a pattern anywhere within the input string (which fits this use case more correctly).
Added unit tests.
Should be backported to 2.0.
Committer Checklist (excluded from commit message)