-
Notifications
You must be signed in to change notification settings - Fork 26
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
[close #232] Add https for tikv sink #233
Conversation
Signed-off-by: zeminzhou <[email protected]>
Signed-off-by: zeminzhou <[email protected]>
pdAddrPrefix := "http://" | ||
|
||
if sinkURI.Query().Get("ca-path") != "" { | ||
config.Security = tikvconfig.NewSecurity( |
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.
Could CA
CERT
and KEY
be set by config file?
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #233 +/- ##
================================================
+ Coverage 61.1273% 61.1528% +0.0255%
================================================
Files 239 239
Lines 20207 20210 +3
================================================
+ Hits 12352 12359 +7
+ Misses 6739 6709 -30
- Partials 1116 1142 +26
*This pull request uses carry forward flags. Click here to find out more.
|
cdc/cdc/sink/tikv_test.go
Outdated
require := require.New(t) | ||
|
||
uri := "tikv://127.0.0.1:1001,127.0.0.2:1002/?concurrency=10" | ||
uri := "tikv://127.0.0.1:1001,127.0.0.2:1002/?concurrency=10&ca-path=./ca-cert.pem&cert-path=./client-cert.pem&key-path=./client-key" |
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.
Suggest to keep test case with no tls.
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.
I added it back. PTAL~
cdc/tests/utils/rawkv_data/main.go
Outdated
} | ||
|
||
func (cfg *Config) ParseFromFlags(flags *pflag.FlagSet) error { | ||
func (cfg *Config) ParseFromFlags(flags *pflag.FlagSet, useDstPD bool) error { |
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: useDstPD
-> requireDstPD
Signed-off-by: zeminzhou <[email protected]>
Signed-off-by: zeminzhou <[email protected]>
cdc/cdc/sink/tikv_test.go
Outdated
opts := make(map[string]string) | ||
config, pdAddr, err := parseTiKVUri(sinkURI, opts) | ||
require.NoError(err) | ||
require.Len(pdAddr, expected[i].pdAddrCount) |
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.
Seems not necessary to verify Len
. pdAddr
with different length must not be equal.
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.
Removed, PTAL~
Signed-off-by: zeminzhou <[email protected]>
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.
LGTM~
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.
LGTM
Signed-off-by: zeminzhou <[email protected]>
Signed-off-by: zeminzhou <[email protected]>
Signed-off-by: zeminzhou <[email protected]>
Signed-off-by: zeminzhou [email protected]
What problem does this PR solve?
Support https for tikv sink
Issue Number: close #232
Problem Description: TBD
What is changed and how does it work?
Create tikv client with security.
Code changes
Check List for Tests
This PR has been tested by at least one of the following methods: