Skip to content
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

Return error when loading some undefined configs from local #687

Merged
merged 13 commits into from
Jul 24, 2019

Conversation

lichunzhu
Copy link
Contributor

@lichunzhu lichunzhu commented Jul 23, 2019

What problem does this PR solve?

TOOL-1403
Referral PR: TiDB#9855

What is changed and how it works?

Now func configFromFile in config.go of drainer, pump, arbiter, reparo will make sure that there is no undecoded args in metaData. This can help customers check their misspell in the config toml files. Relative tests have been added, too.

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

Related changes

drainer/config_test.go Outdated Show resolved Hide resolved
@lichunzhu lichunzhu changed the title Czli/handle invalid toml options Return error when loading some undefined config from local Jul 23, 2019
@lichunzhu lichunzhu changed the title Return error when loading some undefined config from local Return error when loading some undefined configs from local Jul 23, 2019
drainer/config.go Outdated Show resolved Hide resolved
drainer/config_test.go Outdated Show resolved Hide resolved
drainer/config_test.go Show resolved Hide resolved
drainer/config.go Outdated Show resolved Hide resolved
pkg/util/util.go Outdated Show resolved Hide resolved
pkg/util/util.go Outdated Show resolved Hide resolved
… for unrecognized option, make the unrecognized option test more strict, change error handle way in /*/config.go
pump/config_test.go Outdated Show resolved Hide resolved
@lichunzhu lichunzhu force-pushed the czli/handleInvalidTomlOptions branch from c2a0872 to 827732d Compare July 24, 2019 05:13
arbiter/config.go Outdated Show resolved Hide resolved
Copy link
Contributor

@suzaku suzaku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@kennytm kennytm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

reparo/config.go Outdated Show resolved Hide resolved
reparo/config_test.go Outdated Show resolved Hide resolved
arbiter/config_test.go Outdated Show resolved Hide resolved
drainer/config_test.go Outdated Show resolved Hide resolved
pkg/util/util.go Outdated Show resolved Hide resolved
pump/config_test.go Show resolved Hide resolved
arbiter/config.go Outdated Show resolved Hide resolved
@kennytm
Copy link
Contributor

kennytm commented Jul 24, 2019

/run-all-tests

@kennytm kennytm merged commit 47163d0 into pingcap:master Jul 24, 2019
@lichunzhu lichunzhu deleted the czli/handleInvalidTomlOptions branch July 26, 2019 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants