You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/09/25 12:57:59 UTC

[GitHub] [dubbo-go] jiangy opened a new pull request, #2061: feat: nacosRegistry and polarisRegistry support register ip and port from env

jiangy opened a new pull request, #2061:
URL: https://github.com/apache/dubbo-go/pull/2061

   
   <!--  Thanks for sending a pull request!
   Read https://github.com/apache/dubbo-go/blob/master/CONTRIBUTING.md before commit pull request.
   -->
   
   **What this PR does**: 
   
   **Which issue(s) this PR fixes**: 
   Fixes #2060 
   
   **You should pay attention to items below to ensure your pr passes our ci test**
   We do not merge pr with ci tests failed
   
   - [ ] All ut passed (run 'go test ./...' in project root)
   - [ ] After go-fmt ed , run 'go fmt project' using goland.
   - [ ] Golangci-lint passed, run 'sudo golangci-lint run' in project root.
   - [ ] Your new-created file needs to have [apache license](https://raw.githubusercontent.com/dubbogo/resources/master/tools/license/license.txt) at the top, like other existed file does.
   - [ ] All integration test passed. You can run integration test locally (with docker env). Clone our [dubbo-go-samples](https://github.com/apache/dubbo-go-samples) project and replace the go.mod to your dubbo-go, and run 'sudo sh start_integration_test.sh' at root of samples project root. (M1 Slice is not Support)


-- 
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


[GitHub] [dubbo-go] justxuewei commented on a diff in pull request #2061: feat: nacosRegistry and polarisRegistry support register ip and port from env

Posted by GitBox <gi...@apache.org>.
justxuewei commented on code in PR #2061:
URL: https://github.com/apache/dubbo-go/pull/2061#discussion_r979533185


##########
common/host_util.go:
##########
@@ -30,3 +32,19 @@ func GetLocalIp() string {
 	localIp, _ = gxnet.GetLocalIP()
 	return localIp
 }
+
+func HandleRegisterIPAndPort(url *URL) {
+	// if developer define registry port and ip, use it first.
+	if ipToRegistry := os.Getenv("DUBBO_IP_TO_REGISTRY"); len(ipToRegistry) > 0 {

Review Comment:
   Please create a const for `DUBBO_IP_TO_REGISTRY` in `https://github.com/apache/dubbo-go/blob/master/common/constant/env.go`



-- 
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


[GitHub] [dubbo-go] codecov-commenter commented on pull request #2061: feat: nacosRegistry and polarisRegistry support register ip and port from env

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #2061:
URL: https://github.com/apache/dubbo-go/pull/2061#issuecomment-1257928128

   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/2061?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2061](https://codecov.io/gh/apache/dubbo-go/pull/2061?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (47159bc) into [3.0](https://codecov.io/gh/apache/dubbo-go/commit/1c3be3394da6223b9ad251ae7eb831167ace370f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1c3be33) will **decrease** coverage by `0.13%`.
   > The diff coverage is `68.75%`.
   
   > :exclamation: Current head 47159bc differs from pull request most recent head bb48e50. Consider uploading reports for the commit bb48e50 to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##              3.0    #2061      +/-   ##
   ==========================================
   - Coverage   44.75%   44.61%   -0.14%     
   ==========================================
     Files         283      281       -2     
     Lines       17108    16831     -277     
   ==========================================
   - Hits         7656     7509     -147     
   + Misses       8643     8535     -108     
   + Partials      809      787      -22     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/2061?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [metadata/definition/definition.go](https://codecov.io/gh/apache/dubbo-go/pull/2061/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0YWRhdGEvZGVmaW5pdGlvbi9kZWZpbml0aW9uLmdv) | `70.66% <ø> (ø)` | |
   | [metadata/identifier/base\_metadata\_identifier.go](https://codecov.io/gh/apache/dubbo-go/pull/2061/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0YWRhdGEvaWRlbnRpZmllci9iYXNlX21ldGFkYXRhX2lkZW50aWZpZXIuZ28=) | `86.48% <0.00%> (-7.64%)` | :arrow_down: |
   | [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/2061/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `26.49% <0.00%> (-8.61%)` | :arrow_down: |
   | [xds/client/bootstrap/bootstrap.go](https://codecov.io/gh/apache/dubbo-go/pull/2061/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-eGRzL2NsaWVudC9ib290c3RyYXAvYm9vdHN0cmFwLmdv) | `59.11% <0.00%> (ø)` | |
   | [xds/utils/credentials/xds/handshake\_info.go](https://codecov.io/gh/apache/dubbo-go/pull/2061/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-eGRzL3V0aWxzL2NyZWRlbnRpYWxzL3hkcy9oYW5kc2hha2VfaW5mby5nbw==) | `41.46% <ø> (ø)` | |
   | [common/host\_util.go](https://codecov.io/gh/apache/dubbo-go/pull/2061/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL2hvc3RfdXRpbC5nbw==) | `100.00% <100.00%> (+40.00%)` | :arrow_up: |
   | [registry/nacos/registry.go](https://codecov.io/gh/apache/dubbo-go/pull/2061/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVnaXN0cnkvbmFjb3MvcmVnaXN0cnkuZ28=) | `46.00% <100.00%> (+2.68%)` | :arrow_up: |
   | [cluster/cluster/base/cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/2061/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2x1c3Rlci9jbHVzdGVyL2Jhc2UvY2x1c3Rlcl9pbnZva2VyLmdv) | `24.44% <0.00%> (-13.34%)` | :arrow_down: |
   | [cluster/loadbalance/ringhash/ring.go](https://codecov.io/gh/apache/dubbo-go/pull/2061/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2x1c3Rlci9sb2FkYmFsYW5jZS9yaW5naGFzaC9yaW5nLmdv) | `84.50% <0.00%> (-2.82%)` | :arrow_down: |
   | ... and [6 more](https://codecov.io/gh/apache/dubbo-go/pull/2061/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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


[GitHub] [dubbo-go] justxuewei commented on a diff in pull request #2061: feat: nacosRegistry and polarisRegistry support register ip and port from env

Posted by GitBox <gi...@apache.org>.
justxuewei commented on code in PR #2061:
URL: https://github.com/apache/dubbo-go/pull/2061#discussion_r979533185


##########
common/host_util.go:
##########
@@ -30,3 +32,19 @@ func GetLocalIp() string {
 	localIp, _ = gxnet.GetLocalIP()
 	return localIp
 }
+
+func HandleRegisterIPAndPort(url *URL) {
+	// if developer define registry port and ip, use it first.
+	if ipToRegistry := os.Getenv("DUBBO_IP_TO_REGISTRY"); len(ipToRegistry) > 0 {

Review Comment:
   Please create a const for `DUBBO_IP_TO_REGISTRY` in [common/constant/env.go](https://github.com/apache/dubbo-go/blob/master/common/constant/env.go)



##########
common/host_util.go:
##########
@@ -30,3 +32,19 @@ func GetLocalIp() string {
 	localIp, _ = gxnet.GetLocalIP()
 	return localIp
 }
+
+func HandleRegisterIPAndPort(url *URL) {
+	// if developer define registry port and ip, use it first.
+	if ipToRegistry := os.Getenv("DUBBO_IP_TO_REGISTRY"); len(ipToRegistry) > 0 {

Review Comment:
   Please create a const for `DUBBO_IP_TO_REGISTRY` in [common/constant/env.go](https://github.com/apache/dubbo-go/blob/master/common/constant/env.go).



-- 
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


[GitHub] [dubbo-go] AlexStocks merged pull request #2061: feat: nacosRegistry and polarisRegistry support register ip and port from env

Posted by GitBox <gi...@apache.org>.
AlexStocks merged PR #2061:
URL: https://github.com/apache/dubbo-go/pull/2061


-- 
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


[GitHub] [dubbo-go] justxuewei commented on a diff in pull request #2061: feat: nacosRegistry and polarisRegistry support register ip and port from env

Posted by GitBox <gi...@apache.org>.
justxuewei commented on code in PR #2061:
URL: https://github.com/apache/dubbo-go/pull/2061#discussion_r979534265


##########
common/host_util.go:
##########
@@ -30,3 +32,19 @@ func GetLocalIp() string {
 	localIp, _ = gxnet.GetLocalIP()
 	return localIp
 }
+
+func HandleRegisterIPAndPort(url *URL) {
+	// if developer define registry port and ip, use it first.
+	if ipToRegistry := os.Getenv("DUBBO_IP_TO_REGISTRY"); len(ipToRegistry) > 0 {
+		url.Ip = ipToRegistry
+	}
+	if len(url.Ip) == 0 {
+		url.Ip = GetLocalIp()
+	}
+	if portToRegistry := os.Getenv("DUBBO_PORT_TO_REGISTRY"); len(portToRegistry) > 0 {
+		url.Port = portToRegistry
+	}

Review Comment:
   Plus, I am thinking here needs a port inspection, for example, a port exceeded 65535.



-- 
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


[GitHub] [dubbo-go] justxuewei commented on a diff in pull request #2061: feat: nacosRegistry and polarisRegistry support register ip and port from env

Posted by GitBox <gi...@apache.org>.
justxuewei commented on code in PR #2061:
URL: https://github.com/apache/dubbo-go/pull/2061#discussion_r979533410


##########
common/host_util.go:
##########
@@ -30,3 +32,19 @@ func GetLocalIp() string {
 	localIp, _ = gxnet.GetLocalIP()
 	return localIp
 }
+
+func HandleRegisterIPAndPort(url *URL) {
+	// if developer define registry port and ip, use it first.
+	if ipToRegistry := os.Getenv("DUBBO_IP_TO_REGISTRY"); len(ipToRegistry) > 0 {
+		url.Ip = ipToRegistry
+	}
+	if len(url.Ip) == 0 {
+		url.Ip = GetLocalIp()
+	}
+	if portToRegistry := os.Getenv("DUBBO_PORT_TO_REGISTRY"); len(portToRegistry) > 0 {

Review Comment:
   Please create a const for `DUBBO_PORT_TO_REGISTRY` in [common/constant/env.go](https://github.com/apache/dubbo-go/blob/master/common/constant/env.go).



-- 
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