Alanxtl commented on code in PR #3029:
URL: https://github.com/apache/dubbo-go/pull/3029#discussion_r2442786330


##########
registry/directory/directory.go:
##########
@@ -83,11 +83,49 @@ func NewRegistryDirectory(url *common.URL, registry 
registry.Registry) (director
        }
        logger.Debugf("new RegistryDirectory for service :%s.", url.Key())
 
+       // set application if not exist
        if _, ok := url.GetAttribute(constant.ApplicationKey); !ok {
                application := config.GetRootConfig().Application
                if application == nil {
                        defaultAppConfig := global.DefaultApplicationConfig()
                        url.SetAttribute(constant.ApplicationKey, 
defaultAppConfig)
+               } else {
+                       url.SetAttribute(constant.ApplicationKey, application)
+               }
+       }
+       // set registry if not exist
+       if _, ok := url.GetAttribute(constant.RegistryKey); !ok {
+               configRegistries := config.GetRootConfig().Registries

Review Comment:
   ```suggestion
           // TODO: Temporary compatibility with old APIs, can be removed later
                configRegistries := config.GetRootConfig().Registries
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to