-
Notifications
You must be signed in to change notification settings - Fork 28
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
api: refactor config API to adapt tidb-operator/TOML changes #176
Conversation
Signed-off-by: xhe <xw897002528@gmail.com>
@@ -118,12 +117,11 @@ func TestUpdateCfg(t *testing.T) { | |||
err := os.RemoveAll(dir) | |||
require.NoError(t, err) | |||
|
|||
clonedCfg := cfg.LogOnline | |||
test.updateCfg(&clonedCfg) | |||
// Push it 2 times to make sure the first one has already taken affect. |
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.
Our kvmap impl will not suffer problems like etcd, no need to put 2 times.
Signed-off-by: xhe <xw897002528@gmail.com>
for { | ||
select { | ||
case <-ctx.Done(): | ||
return | ||
case cfg := <-cfgCh: | ||
case acfg := <-cfgch: | ||
cfg := &acfg.Log.LogOnline |
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.
If the event type is delete, acfg
is empty.
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.
No delete in the current implementation.
And it is ensured to be valid pointer:
var c config.Config
if k.Type == KVEventDel {
ch <- &c
} else {
It is valid if user wants to reset to default, for example.
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe xw897002528@gmail.com
What problem does this PR solve?
Issue Number: ref #161
Problem Summary: Due to we have adapt
ConfigWrapper
intidb-operator
, it becomes harder to set config for each component separately. Further more, we need to issue two requests for each instace. Instead, we just upload the whole config, and pick updatable part now.What is changed and how it works:
config [log | proxy] [get | put]
is replaced by one single commandtiproxyctl config get/put
XXXOnlineConfig
are replaced bychan *config.Config
ConfigManager.Init()
Check List
Tests
Notable changes
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.