-
Notifications
You must be signed in to change notification settings - Fork 949
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
bugfix: check int type is empty #2235
Conversation
|
LGTM |
test failed :
|
daemon/config/config.go
Outdated
@@ -193,7 +198,6 @@ func (cfg *Config) MergeConfigurations(flagSet *pflag.FlagSet) error { | |||
// merge configurations from command line flags and config file | |||
err = mergeConfigurations(fileConfig, cfg.delValue(flagSet, fileFlags)) | |||
return err |
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.
directly return mergeConfigurations(fileConfig, cfg.delValue(flagSet, fileFlags))
?
check int type is empty when do the merge. Signed-off-by: Rudy Zhang <rudyflyzhang@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #2235 +/- ##
==========================================
- Coverage 66.56% 66.51% -0.05%
==========================================
Files 208 208
Lines 16756 16759 +3
==========================================
- Hits 11153 11148 -5
- Misses 4276 4283 +7
- Partials 1327 1328 +1
|
For this change, LGTM. We should think about the default boolean value in next PR. ping @allencloud @Ace-Tang |
@@ -191,9 +196,7 @@ func (cfg *Config) MergeConfigurations(flagSet *pflag.FlagSet) error { | |||
} | |||
|
|||
// merge configurations from command line flags and config file | |||
err = mergeConfigurations(fileConfig, cfg.delValue(flagSet, fileFlags)) |
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.
Why split return mergeConfigurations
into err = ... ; return err
before?
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.
because the caller will check the error, no need to check before return
@fuweid , current merge method is not suit for pouch config now, like we disscussed offline before. |
@Ace-Tang could we merge this PR? |
Ⅰ. Describe what this PR did
check int type is empty when do the merge.
For example, the default value of bridge's mtu is 1500, if the daemon config haven't configed bridge's mtu, the problem will set the mtu to 0, instead of default value 1500.
Ⅱ. Does this pull request fix one issue?
NONE
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
NONE
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
Signed-off-by: Rudy Zhang rudyflyzhang@gmail.com