You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Alanxtl (via GitHub)" <gi...@apache.org> on 2025/10/19 06:33:05 UTC

Re: [PR] chore: update tag and polaris from config to global [dubbo-go]

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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org