Skip to content

Commit

Permalink
registry 默认值问题 (apache#1275)
Browse files Browse the repository at this point in the history
Co-authored-by: wangxiaowei14227 <wangxiaowei14227@autohome.com.cn>
  • Loading branch information
2 people authored and mark4z committed Jul 5, 2021
1 parent aa4f87e commit c642c08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/config_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func setDefaultValue(target interface{}) {
switch target.(type) {
case *ProviderConfig:
p := target.(*ProviderConfig)
if len(p.Registries) == 0 {
if len(p.Registries) == 0 && p.Registry == nil {
p.Registries[constant.DEFAULT_REGISTRY_ZK_ID] = registryConfig
}
if len(p.Protocols) == 0 {
Expand All @@ -117,7 +117,7 @@ func setDefaultValue(target interface{}) {
}
default:
c := target.(*ConsumerConfig)
if len(c.Registries) == 0 {
if len(c.Registries) == 0 && c.Registry == nil {
c.Registries[constant.DEFAULT_REGISTRY_ZK_ID] = registryConfig
}
if c.ApplicationConfig == nil {
Expand Down

0 comments on commit c642c08

Please sign in to comment.