-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[improve][io] Debezium sources: Support loading config from secrets #19004
Merged
Conversation
This file contains 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
codelipenghui
approved these changes
Dec 21, 2022
nicoloboschi
requested changes
Dec 21, 2022
pulsar-io/debezium/core/src/main/java/org/apache/pulsar/io/debezium/DebeziumSource.java
Outdated
Show resolved
Hide resolved
pulsar-io/debezium/core/src/main/java/org/apache/pulsar/io/debezium/DebeziumSource.java
Show resolved
Hide resolved
alpreu
force-pushed
the
io-debezium-config-secrets
branch
from
December 21, 2022 13:26
58617b1
to
9d5a50c
Compare
nicoloboschi
approved these changes
Dec 21, 2022
/pulsarbot rerun-failure-checks |
Codecov Report
@@ Coverage Diff @@
## master #19004 +/- ##
============================================
+ Coverage 46.35% 46.91% +0.55%
- Complexity 8939 10548 +1609
============================================
Files 597 709 +112
Lines 56858 69363 +12505
Branches 5905 7441 +1536
============================================
+ Hits 26357 32542 +6185
- Misses 27616 33165 +5549
- Partials 2885 3656 +771
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Technoboy-
approved these changes
Dec 23, 2022
alpreu
pushed a commit
to alpreu/pulsar
that referenced
this pull request
Jan 9, 2023
15 tasks
alpreu
pushed a commit
to alpreu/pulsar
that referenced
this pull request
Jan 12, 2023
This was referenced Jan 12, 2023
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.
Motivation
Currently the Debezium sources don't support loading sensitive configuration from secrets.
Modifications
Most sources can rely on
IOConfigUtils.loadWithSecrets
because they provide a specific Config class withFieldDoc
annotations. The Debezium sources work differently because there is no specific Config class but rather just a Map with some basic validation that is passed to Debezium. Therefore we need to directly get the secrets from thesourceContext
.Most of the Debezium sources rely on the same config properties (
database.user
,database.password
) to configure the connector so I decided to move the secret-handling code into the abstractDebeziumSource
class that all the individual connectors inherit from. There are exceptions to this, such as the MongoDB source, which uses another set of config properties (e.g.mongodb.user
instead ofdatabase.user
), these sources will have to call the secret-handling code by overriding theopen
method.Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
I would be open to adding a unit test as well, but I feel it does not add a lot of value because the sourceContext already has unit tests for this functionality.
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: alpreu#4